Просмотр исходного кода

feat(add ansible configuration and new hosts)

Douglas A 4 лет назад
Родитель
Сommit
2f416b7442
2 измененных файлов с 34 добавлено и 0 удалено
  1. 31 0
      ansible-conf.yml
  2. 3 0
      hosts

+ 31 - 0
ansible-conf.yml

@@ -0,0 +1,31 @@
+---
+- hosts: all
+  become_user: root
+  become: yes
+
+  tasks:
+  - name: Make sure we have a wheel group
+    ansible.builtin.group:
+      name: wheel
+      state: present
+
+  - name: Allow wheel group to have passwordless sudo
+    lineinfile:
+      dest: /etc/sudoers
+      state: present
+      regexp: '^%wheel'
+      line: '%wheel ALL=(ALL) NOPASSWD: ALL'
+      validate: 'visudo -cf %s'
+
+  - name: Add sudoers users to wheel group
+    user:
+      name=ansible
+      groups=wheel
+      append=yes
+      state=present
+      createhome=yes
+  
+  - name: Set up authorized keys for the deployer user
+    authorized_key: user=ansible key="{{item}}"
+    with_file:
+      - /home/cmte/.ssh/id_rsa.pub

+ 3 - 0
hosts

@@ -11,6 +11,9 @@
 192.168.100.100
 192.168.100.15
 192.168.180.7
+192.168.180.8
+192.168.180.9
+192.168.190.2
 plex.delta.labs.andreanidr.com
 
 [debian:vars]