Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Use package state 'present' since 'installed' is deprecated #154

Merged
merged 1 commit into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
- name: wrapper playbook for kitchen testing "ansible-ssh-hardening" with default settings
hosts: localhost
pre_tasks:
- package: name="{{item}}" state=installed
- package: name="{{item}}" state=present
with_items:
- "openssh-clients"
- "openssh-server"
ignore_errors: true
- apt: name="{{item}}" state=installed update_cache=true
- apt: name="{{item}}" state=present update_cache=true
with_items:
- "openssh-client"
- "openssh-server"
Expand Down
4 changes: 2 additions & 2 deletions default_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
- name: wrapper playbook for kitchen testing "ansible-ssh-hardening" with custom settings
hosts: localhost
pre_tasks:
- package: name="{{item}}" state=installed
- package: name="{{item}}" state=present
with_items:
- "openssh-clients"
- "openssh-server"
ignore_errors: true
- apt: name="{{item}}" state=installed update_cache=true
- apt: name="{{item}}" state=present update_cache=true
with_items:
- "openssh-client"
- "openssh-server"
Expand Down
8 changes: 4 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@

- block:
- name: Install google authenticator PAM module
apt: name=libpam-google-authenticator state=installed
apt: name=libpam-google-authenticator state=present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- name: Install google authenticator PAM module
yum: name=google-authenticator state=installed
yum: name=google-authenticator state=present
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Oracle Linux'

- name: Add google auth module to PAM
Expand Down Expand Up @@ -92,14 +92,14 @@

- block: # only runs when selinux is installed
- name: install selinux dependencies when selinux is installed on RHEL or Oracle Linux
package: name="{{item}}" state=installed
package: name="{{item}}" state=present
with_items:
- policycoreutils-python
- checkpolicy
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Oracle Linux'

- name: install selinux dependencies when selinux is installed on Debian or Ubuntu
apt: name="{{item}}" state=installed
apt: name="{{item}}" state=present
with_items:
- policycoreutils
- checkpolicy
Expand Down