fix bare variables is deprecated warning

parent 0a993c8d
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
install_recommends: yes install_recommends: yes
state: present state: present
update_cache: yes update_cache: yes
with_items: common_debian_pkgs with_items: "{{ common_debian_pkgs }}"
when: ansible_distribution in common_debian_variants when: ansible_distribution in common_debian_variants
- name: Install role-independent useful system packages - name: Install role-independent useful system packages
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
name: "{{ item }}" name: "{{ item }}"
state: present state: present
update_cache: yes update_cache: yes
with_items: common_redhat_pkgs with_items: "{{ common_redhat_pkgs }}"
when: ansible_distribution in common_redhat_variants when: ansible_distribution in common_redhat_variants
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
owner: "{{ item.owner | default('root') }}" owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default('root') }}" group: "{{ item.group | default('root') }}"
mode: 0755 mode: 0755
with_items: common_directories with_items: "{{ common_directories }}"
- name: upload sudo config for key forwarding as root - name: upload sudo config for key forwarding as root
copy: copy:
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
name: "{{ item }}" name: "{{ item }}"
state: present state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
with_items: common_pip_pkgs with_items: "{{ common_pip_pkgs }}"
when: ansible_distribution in common_debian_variants when: ansible_distribution in common_debian_variants
......
...@@ -27,6 +27,5 @@ ...@@ -27,6 +27,5 @@
install_recommends: yes install_recommends: yes
state: present state: present
update_cache: yes update_cache: yes
with_items: server_utils_debian_pkgs with_items: "{{ server_utils_debian_pkgs }}"
when: when: ansible_distribution == 'Ubuntu'
- ansible_distribution == 'Ubuntu'
...@@ -104,21 +104,21 @@ ...@@ -104,21 +104,21 @@
shell: /bin/bash shell: /bin/bash
remove: yes remove: yes
state: "{{ item.state | default('present') }}" state: "{{ item.state | default('present') }}"
with_items: user_info with_items: "{{ user_info }}"
- name: assign admin role to admin users - name: assign admin role to admin users
user: user:
name: "{{ item.name }}" name: "{{ item.name }}"
groups: edxadmin groups: edxadmin
when: item.type is defined and item.type == 'admin' and item.get('state', 'present') == 'present' when: item.type is defined and item.type == 'admin' and item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
- name: get github key(s) and update the authorized_keys file - name: get github key(s) and update the authorized_keys file
authorized_key: authorized_key:
user: "{{ item.name }}" user: "{{ item.name }}"
key: "https://github.com/{{ item.name }}.keys" key: "https://github.com/{{ item.name }}.keys"
when: item.github is defined and item.get('state', 'present') == 'present' when: item.github is defined and item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
- name: create bashrc file for normal users - name: create bashrc file for normal users
template: template:
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
mode: 0640 mode: 0640
owner: "{{ item.name }}" owner: "{{ item.name }}"
when: not (item.type is defined and item.type == 'restricted') and item.get('state', 'present') == 'present' when: not (item.type is defined and item.type == 'restricted') and item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
- name: create .profile for all users - name: create .profile for all users
template: template:
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
mode: 0640 mode: 0640
owner: "{{ item.name }}" owner: "{{ item.name }}"
when: item.get('state', 'present') == 'present' when: item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
######################################################## ########################################################
# All tasks below this line are for restricted users # All tasks below this line are for restricted users
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
name: "{{ item.name }}" name: "{{ item.name }}"
shell: /bin/rbash shell: /bin/rbash
when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present' when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
- name: create bashrc file for restricted users - name: create bashrc file for restricted users
template: template:
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
mode: 0640 mode: 0640
owner: "{{ item.name }}" owner: "{{ item.name }}"
when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present' when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
- name: create sudoers file from template - name: create sudoers file from template
template: template:
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
- name: change home directory ownership to root for restricted users - name: change home directory ownership to root for restricted users
shell: "chown -R root:{{ item.name }} /home/{{ item.name }}" shell: "chown -R root:{{ item.name }} /home/{{ item.name }}"
when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present' when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
- name: create ~/bin directory - name: create ~/bin directory
file: file:
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
owner: root owner: root
group: "{{ item.name }}" group: "{{ item.name }}"
when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present' when: item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items: user_info with_items: "{{ user_info }}"
- name: create allowed command links - name: create allowed command links
file: file:
...@@ -191,5 +191,5 @@ ...@@ -191,5 +191,5 @@
state: link state: link
when: item[0].type is defined and item[0].type == 'restricted' and item[0].get('state', 'present') == 'present' when: item[0].type is defined and item[0].type == 'restricted' and item[0].get('state', 'present') == 'present'
with_nested: with_nested:
- user_info - "{{ user_info }}"
- user_rbash_links - "{{ user_rbash_links }}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment