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

Аватар автора
Питоновский язык инноваций
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 vi create_admin_user/tasks/main.yml - name: Add the user with a specific uid and a primary group of "admin" ansible.builtin.user: name: "{{ item.name }}" uid: "{{ item.uid }}" loop: "{{ admin }}" - name: Setup authorized key ansible.posix.authorized_key: user: "{{ item.name }}" key: "{{ lookup(&&item.name }}.pub&}}" loop: "{{ admin }}" - name: Update sudoers file and validate ansible.builtin.lineinfile: dest: /etc/sudoers insertafter: EOF line: "{{ item.name }} ALL=(ALL) NOPASSWD: ALL" regexp: "^{{ item.name }} .*" state: present loop: "{{ admin }}" vi create_admin_user/vars/main.yml admin: - name: 'thelazysysadmin' comment: &User' uid: '1000' - name: 'semaphore' comment: &App User' uid: '1001' sudo su - semaphore ssh-keygen exit mkdir create_admin_user/files/pub_keys/ sudo cp /opt/semaphore/.ssh/ansible.pub create_admin_user/files/pub_keys/semaphore.pub cp ~/.ssh/ansible.pub create_admin_user/files/pub_keys/thelazysysadmin.pub cd .. mkdir playbooks/users vi playbooks/users/create_admin_user.yml --- - hosts: all gather_facts: yes become: yes become_user: root tasks:...

0/0


0/0

0/0

0/0