Skip to content

Commit

Permalink
Don't loop over apt (#34)
Browse files Browse the repository at this point in the history
* don't loop over apt use a list of names instead

* use consistent tab depth

* fix another apt loop

* parse var as jinja2
  • Loading branch information
smiller171 authored and florianutz committed May 11, 2019
1 parent cf07eb8 commit d87bcf8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
masked: false
state: reloaded
when: ansible_virtualization_type != "docker"
ignore_errors: ubuntu1604cis_ignore_remount_errors
ignore_errors: "{{ ubuntu1604cis_ignore_remount_errors }}"

- name: systemd restart var-tmp.mount
become: true
Expand All @@ -36,7 +36,7 @@
enabled: true
masked: false
state: reloaded
ignore_errors: ubuntu1604cis_ignore_remount_errors
ignore_errors: "{{ ubuntu1604cis_ignore_remount_errors }}"

- name: generate new grub config
become: true
Expand Down
5 changes: 2 additions & 3 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
pre_tasks:
- name: install packages for testing under docker
apt:
name: "{{ item }}"
name:
- openssh-server
state: present
with_items:
- openssh-server
- name: pretask2
file:
name: /boot/grub
Expand Down
3 changes: 1 addition & 2 deletions tasks/post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@

- name: "POST | Perform apt package cleanup"
apt:
name: "{{ item }}"
name: "{{ apt_rc_packages.stdout_lines }}"
state: absent
purge: true
changed_when: false
ignore_errors: true
with_items: "{{ apt_rc_packages.stdout_lines }}"
tags:
- skip_ansible_lint
7 changes: 3 additions & 4 deletions tasks/section2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,10 @@

- name: "SCORED | 2.2.2 | PATCH | Ensure X Window System is not installed"
apt:
name: "{{ item }}"
name:
- "@X Window System"
- "x11*"
state: absent
with_items:
- "@X Window System"
- "x11*"
when:
- not ubuntu1604cis_xwindows_required
- ubuntu1604cis_rule_2_2_2
Expand Down

0 comments on commit d87bcf8

Please sign in to comment.