From a163dc01a39f763cd133bb67a407f481b6f47f57 Mon Sep 17 00:00:00 2001 From: Vladimir Vitkov <5081863+zeridon@users.noreply.github.com> Date: Mon, 29 Jul 2019 15:04:32 +0300 Subject: [PATCH] Add some ansible --- ansible/ansible.cfg | 3 ++- ansible/group_vars/all/default.yml | 7 ++++++- ansible/playbooks/roles/common/tasks/main.yml | 2 +- ansible/site.yml | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 ansible/site.yml diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 0670089..34e4d7b 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -3,6 +3,7 @@ inventory = hosts remote_tmp = /tmp forks = 50 nocols = 1 +nocolor = True remote_user = root vault_password_file = ~/.of2019-vault-pass roles_path = playbooks/roles @@ -10,4 +11,4 @@ host_key_checking = False [ssh_connection] pipelining = True -ssh_args = -C -o ControlMaster=auto -o ControlPersist=600s -o PasswordAuthentication=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null +ssh_args = -C -o ControlMaster=auto -o ControlPersist=600s -o PasswordAuthentication=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlPath=/tmp/ansible-ssh-%h-%p-%r diff --git a/ansible/group_vars/all/default.yml b/ansible/group_vars/all/default.yml index e8c69f5..fb18dc5 100644 --- a/ansible/group_vars/all/default.yml +++ b/ansible/group_vars/all/default.yml @@ -5,6 +5,11 @@ ssh_users: - zeridon - maniax - arcopix + - hackman + - lz1irq + - shteryana + - tochev + - Yasen6275 timezone: "Europe/Sofia" @@ -12,4 +17,4 @@ ntp: server: - marla.ludost.net pool: - - 0.bg.pool.ntp.org \ No newline at end of file + - 0.bg.pool.ntp.org diff --git a/ansible/playbooks/roles/common/tasks/main.yml b/ansible/playbooks/roles/common/tasks/main.yml index 2816830..bcf9df9 100644 --- a/ansible/playbooks/roles/common/tasks/main.yml +++ b/ansible/playbooks/roles/common/tasks/main.yml @@ -29,7 +29,7 @@ - name: "add ssh keys to root" authorized_key: user: root - key: "{{ lookup('file', '../../access/ssh-keys/'+item+'.key') }}" + key: "{{ lookup('file', '../access/ssh-keys/'+item+'.key') }}" with_items: "{{ ssh_users }}" - name: "configure root user" diff --git a/ansible/site.yml b/ansible/site.yml new file mode 100644 index 0000000..48485e3 --- /dev/null +++ b/ansible/site.yml @@ -0,0 +1,4 @@ +--- +- hosts: all + roles: + - role: common