Reduce output from ansible playbooks. Some minor changes.
This commit is contained in:
@ -10,6 +10,8 @@
|
||||
state: present
|
||||
gid: '{{ item.group_id | default(omit) }}'
|
||||
with_items: '{{ webadmin_user }}'
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
when:
|
||||
- groups['webadmin']|string is search(inventory_hostname)
|
||||
- webadmin_user is defined
|
||||
@ -29,6 +31,8 @@
|
||||
password: "{{ item.password }}"
|
||||
update_password: on_create
|
||||
with_items: '{{ webadmin_user }}'
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
when:
|
||||
- groups['webadmin']|string is search(inventory_hostname)
|
||||
- webadmin_user is defined
|
||||
@ -44,6 +48,8 @@
|
||||
with_subelements:
|
||||
- '{{ webadmin_user }}'
|
||||
- ssh_keys
|
||||
loop_control:
|
||||
label: "{{ item.0.name }}"
|
||||
when:
|
||||
- groups['webadmin']|string is search(inventory_hostname)
|
||||
- webadmin_user is defined
|
||||
@ -62,6 +68,8 @@
|
||||
when:
|
||||
- insert_webadmin_ssh_keypair|bool
|
||||
with_items: '{{ webadmin_ssh_keypair }}'
|
||||
loop_control:
|
||||
label: 'dest: {{ item.priv_key_dest }}'
|
||||
tags:
|
||||
- webadmin
|
||||
- webadmin-defaut-ssh-keypair
|
||||
@ -74,6 +82,8 @@
|
||||
group: '{{ item.login }}'
|
||||
mode: '0644'
|
||||
with_items: '{{ webadmin_ssh_keypair }}'
|
||||
loop_control:
|
||||
label: 'dest: {{ item.pub_key_dest }}'
|
||||
when:
|
||||
- insert_webadmin_ssh_keypair|bool
|
||||
tags:
|
||||
@ -102,6 +112,8 @@
|
||||
key: "{{ lookup('file', item.pub_key_src) }}"
|
||||
state: present
|
||||
with_items: '{{ webadmin_ssh_keypair }}'
|
||||
loop_control:
|
||||
label: 'authorized_keys - webadmin: root'
|
||||
when: inventory_hostname == item.target
|
||||
tags:
|
||||
- webadmin
|
||||
@ -118,6 +130,8 @@
|
||||
path: "~{{ item.name }}/.bashrc.ORIG"
|
||||
register: bashrc_webadmin_orig_exists
|
||||
with_items: "{{ webadmin_user }}"
|
||||
loop_control:
|
||||
label: '{{ item.name }}'
|
||||
tags:
|
||||
- webadmin
|
||||
- bash
|
||||
@ -125,6 +139,8 @@
|
||||
- name: (webadmin-user.yml) Backup existing webadmin's .bashrc file
|
||||
command: cp ~{{ item.item.name }}/.bashrc ~{{ item.item.name }}/.bashrc.ORIG
|
||||
with_items: "{{ bashrc_webadmin_orig_exists.results }}"
|
||||
loop_control:
|
||||
label: '{{ item.item.name }}'
|
||||
when: item.stat.exists == False
|
||||
tags:
|
||||
- webadmin
|
||||
@ -138,6 +154,8 @@
|
||||
group: "{{ item.name }}"
|
||||
mode: 0644
|
||||
with_items: "{{ webadmin_user }}"
|
||||
loop_control:
|
||||
label: '{{ item.name }}'
|
||||
when: lookup('fileglob', inventory_dir + '/files/homedirs/' + item.name + '/_bashrc')
|
||||
tags:
|
||||
- webadmin
|
||||
@ -152,6 +170,8 @@
|
||||
path: "~{{ item.name }}/.profile.ORIG"
|
||||
register: profile_webadmin_orig_exists
|
||||
with_items: "{{ webadmin_user }}"
|
||||
loop_control:
|
||||
label: '{{ item.name }}'
|
||||
tags:
|
||||
- webadmin
|
||||
- profile
|
||||
@ -159,6 +179,8 @@
|
||||
- name: (webadmin-user.yml) Backup existing users .profile file
|
||||
command: cp ~{{ item.item.name }}/.profile ~{{ item.item.name }}/.profile.ORIG
|
||||
with_items: "{{ profile_webadmin_orig_exists.results }}"
|
||||
loop_control:
|
||||
label: '{{ item.item.name }}'
|
||||
when: item.stat.exists == False
|
||||
tags:
|
||||
- webadmin
|
||||
@ -172,6 +194,8 @@
|
||||
group: "{{ item.name }}"
|
||||
mode: 0644
|
||||
with_items: "{{ webadmin_user }}"
|
||||
loop_control:
|
||||
label: '{{ item.name }}'
|
||||
when: lookup('fileglob', inventory_dir + '/files/homedirs/' + item.name + '/_profile')
|
||||
tags:
|
||||
- webadmin
|
||||
@ -189,6 +213,8 @@
|
||||
group: "{{ item.name }}"
|
||||
mode: 0644
|
||||
with_items: "{{ webadmin_user }}"
|
||||
loop_control:
|
||||
label: '{{ item.name }}'
|
||||
when: lookup('fileglob', inventory_dir + '/files/homedirs/' + item.name + '/_vimrc')
|
||||
tags:
|
||||
- webadmin
|
||||
|
Reference in New Issue
Block a user