diff --git a/inventory/deploy/hosts.yaml b/inventory/deploy/hosts.yaml index 6c99f80..5f0106d 100644 --- a/inventory/deploy/hosts.yaml +++ b/inventory/deploy/hosts.yaml @@ -1,7 +1,5 @@ --- physical: - vars_files: - ../../data/secrets.yaml hosts: 192.168.0.5: ansible_become_password: "{{ ansible_become_password }}" \ No newline at end of file diff --git a/roles/0_basic_postinstall/tasks/prepare_ansible_user.yaml b/roles/0_basic_postinstall/tasks/prepare_ansible_user.yaml index b6421a1..b44f405 100644 --- a/roles/0_basic_postinstall/tasks/prepare_ansible_user.yaml +++ b/roles/0_basic_postinstall/tasks/prepare_ansible_user.yaml @@ -24,13 +24,13 @@ name: sshusers state: present -## Add the user to its own group, sshusers (for ssh access) and sudo (gain root access) +## Add the user to sshusers (for ssh access) and sudo (gain root access) - name: Create a new user with a password for Ansible user: name: ansible password: "{{ ansible_user_passwd_hash }}" - groups: ansible,sshusers,sudo + groups: sshusers,sudo append: yes ## Since password authentication in SSH will be disabled, we need to add an authorized key diff --git a/run_playbook.sh b/run_playbook.sh index 1526cd6..dfee666 100755 --- a/run_playbook.sh +++ b/run_playbook.sh @@ -1,2 +1,2 @@ #!/bin/sh -ansible-playbook -i inventory/deploy/hosts.yaml playbooks/deploy.yaml --private-key ~/.ssh/ansible_key \ No newline at end of file +ansible-playbook -i inventory/deploy/hosts.yaml playbooks/deploy.yaml --private-key ~/.ssh/ansible_key --vault-password-file .vault_pass \ No newline at end of file