about summary refs log tree commit diff
path: root/bootstrap.yml
blob: 022194e4be99b5a5756dfc923f34b0033a8dfe68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
- name: Bootstrap base systems
  hosts: tamriel
  remote_user: root
  vars:
    users:
    - login: pawel
      groups: ['sudo', 'remote_access', 'docker']
      pubkey: "{{ lookup('file', '/home/pawel/.ssh/id_rsa.pub') }}"
      shell: /bin/bash
    - login: ansible_worker
      groups: ['sudo', 'remote_access', 'docker']
      pubkey: "{{ lookup('file', '/home/pawel/.ssh/id_rsa.pub') }}"
      shell: /bin/bash
  roles:
  - base_users
  tasks:
  - name: Allow paswordless sudo
    lineinfile:
      dest: /etc/sudoers
      state: present
      insertafter: "^%sudo"
      line: "ansible_worker\tALL=(ALL:ALL) NOPASSWD: ALL"
      validate: '/usr/sbin/visudo -cf %s'
  #    line: "%sudo ALL=(ALL) NOPASSWD: ALL"