Skip to content

Commit

Permalink
Remove bare variables
Browse files Browse the repository at this point in the history
Using bare variables—e.g. `ansible_mounts' within with_ loops is
deprecated from ansible 2.0 onwards. Therefore, you should use the
full variable syntax e.g. `"{{ ansible_mounts }}"'

Fixes major#31

https://docs.ansible.com/ansible/porting_guide_2.0.html
  • Loading branch information
oguya committed May 19, 2016
1 parent c533835 commit 8862044
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions roles/cis/tasks/section_01_level1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
fstype={{ item.fstype }}
opts="nodev,nosuid,noexec"
when: item.mount == "/tmp"
with_items: ansible_mounts
with_items: "{{ ansible_mounts }}"
tags:
- scored
- section1.1
Expand All @@ -53,7 +53,7 @@
fstype="none"
opts="bind"
when: item.mount == "/tmp"
with_items: ansible_mounts
with_items: "{{ ansible_mounts }}"
tags:
- scored
- section1.1
Expand Down Expand Up @@ -88,7 +88,7 @@
fstype={{ item.fstype }}
opts="nodev"
when: item.mount == "/home"
with_items: ansible_mounts
with_items: "{{ ansible_mounts }}"
tags:
- scored
- section1.1
Expand Down
2 changes: 1 addition & 1 deletion roles/cis/tasks/section_07_level1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

- name: 7.2 Disable System Accounts (Scored)
command: /usr/sbin/usermod -s /sbin/nologin {{ item }}
with_items: enabled_system_accounts.stdout_lines
with_items: "{{ enabled_system_accounts.stdout_lines }}"
tags:
- scored
- section7.2
Expand Down
6 changes: 3 additions & 3 deletions roles/cis/tasks/section_08_level1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
state=absent
changed_when: false
with_items:
- stats.results
- "{{ stats.results }}"
when: item.islnk is defined
tags:
- scored
Expand All @@ -44,7 +44,7 @@
state=absent
changed_when: false
with_items:
- stats.results
- "{{ stats.results }}"
when: item.islnk is defined
tags:
- scored
Expand All @@ -56,7 +56,7 @@
state=absent
changed_when: false
with_items:
- stats.results
- "{{ stats.results }}"
when: item.islnk is defined
tags:
- scored
Expand Down

0 comments on commit 8862044

Please sign in to comment.