Setup Ansible Semaphore to Run Playbooks (UI for Ansible - Open Source Ansible Tower Alternative)

preview_player
Показать описание
In this video, you will learn how to setup Ansible Semaphore to run your playbooks.

PLEASE SUBSCRIBE :)
PLEASE HIT LIKE IF IT HELPED :)

Note: It is preferable to use Deploy Keys in GitHub for Ansible-Semaphore because all it requires is a pull. 

LINKS:

Steps:
cd ansible/roles
ansible-galaxy init create_admin_user

- name: Add the user with a specific uid and a primary group of "admin"
loop: "{{ admin }}"

- name: Setup authorized key
loop: "{{ admin }}"

- name: Update sudoers file and validate
dest: /etc/sudoers
insertafter: EOF
state: present
loop: "{{ admin }}"

admin:
- name: 'thelazysysadmin'
comment: 'Ultimate User'
uid: '1000'

- name: 'semaphore'
comment: 'Semaphore App User'
uid: '1001'

sudo su - semaphore
ssh-keygen
exit
mkdir create_admin_user/files/pub_keys/

cd ..
mkdir playbooks/users

---
- hosts: all
gather_facts: yes
become: yes
become_user: root
tasks:
name: create_admin_user

roles_path=roles
host_key_checking=False
private_key_file=~/.ssh/ansible

sudo yum -y install sshpass

Git
cd ansible
git init
git add .
git commit -m "initial"
git branch -M main
git push -u origin main

Chapters:
00:00 Intro
00:19 Setup Create Admin Playbook
02:34 Ansible Configuration
03:11 Run Create Admin Playbook
03:30 Setup Ansible Semaphore
08:52 Setup Git Repository
10:00 Run Ansible Template
12:04 Outro

Drop me your feedback and comments below.

That's all for now.

If this video helped you in any way, please like share and subscribe!

Thank you!!!
Рекомендации по теме
Комментарии
Автор

Don't forget to subscribe! It means a lot!

lazysysad
Автор

Thank You Man) I've got working semaphore) It was not easy for me, who only one time tried use ansible early, but it's work)

ilmiriliasov
Автор

ERROR! couldn't resolve module/action 'ansible.posix.authorized_key', my ansible 2.13.3, how to fix it, thanks

weida
Автор

isn't the inventory user credidentials for the hosts login and password ?

xtensionxward
Автор

How to specify anisble.cfg file to semaphore ?

hrsikesakhitoliya
Автор

anyway to run the playbook in private github repo ? thanks

Автор

Hi, i have this error:

Running playbook failed: exec: "ansible-playbook": executable file not found in $PATH

I stuck there...

Note: i dont use ssh credentials, i was config the key store whit the type "login_password".

Thanks!

Juan-gtrb
Автор

ERROR! the role not found in
The error appears to be in line 8, column 15, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- ansible.builtin.import_role:
name: create_admin_user
^ here. any idea ?

weida