|
|
|
@ -9,8 +9,12 @@
|
|
|
|
|
strategy: mitogen_linear
|
|
|
|
|
become: true
|
|
|
|
|
vars:
|
|
|
|
|
distro: "{{ansible_distribution}}"
|
|
|
|
|
ver: "{{ansible_distribution_major_version}}"
|
|
|
|
|
|
|
|
|
|
special_users:
|
|
|
|
|
- has_sudo
|
|
|
|
|
- has_sudo_nopw
|
|
|
|
|
- has_sudo_pubkey
|
|
|
|
|
- pw_required
|
|
|
|
|
- readonly_homedir
|
|
|
|
@ -19,10 +23,10 @@
|
|
|
|
|
- slow_user
|
|
|
|
|
- webapp
|
|
|
|
|
|
|
|
|
|
groups:
|
|
|
|
|
- has_sudo: ['mitogen__group', '{{sudo_group[distro]}}']
|
|
|
|
|
- has_sudo_pubkey: ['mitogen__group', '{{sudo_group[distro]}}']
|
|
|
|
|
- has_sudo_nopw: ['mitogen__group', 'mitogen__sudo_nopw']
|
|
|
|
|
user_groups:
|
|
|
|
|
has_sudo: ['mitogen__group', '{{sudo_group[distro]}}']
|
|
|
|
|
has_sudo_pubkey: ['mitogen__group', '{{sudo_group[distro]}}']
|
|
|
|
|
has_sudo_nopw: ['mitogen__group', 'mitogen__sudo_nopw']
|
|
|
|
|
|
|
|
|
|
normal_users: "{{
|
|
|
|
|
lookup('sequence', 'start=1 end=5 format=user%d', wantlist=True)
|
|
|
|
@ -53,14 +57,14 @@
|
|
|
|
|
- user:
|
|
|
|
|
name: "mitogen__{{item}}"
|
|
|
|
|
shell: /bin/bash
|
|
|
|
|
groups: "{{groups[item]|default(['mitogen__group'])}}"
|
|
|
|
|
groups: "{{user_groups[item]|default(['mitogen__group'])}}"
|
|
|
|
|
password: "{{ (item + '_password') | password_hash('sha256') }}"
|
|
|
|
|
loop: "{{all_users}}"
|
|
|
|
|
when: ansible_system != 'Darwin'
|
|
|
|
|
- user:
|
|
|
|
|
name: "mitogen__{{item}}"
|
|
|
|
|
shell: /bin/bash
|
|
|
|
|
groups: "{{groups[item]|default(['mitogen__group'])}}"
|
|
|
|
|
groups: "{{user_groups[item]|default(['mitogen__group'])}}"
|
|
|
|
|
password: "{{item}}_password"
|
|
|
|
|
loop: "{{all_users}}"
|
|
|
|
|
when: ansible_system == 'Darwin'
|
|
|
|
|