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

use selinux fact to check if selinux is used #220

Merged
merged 2 commits into from
Apr 30, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .kitchen.vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ provisioner:
http_proxy: <%= ENV['http_proxy'] || nil %>
https_proxy: <%= ENV['https_proxy'] || nil %>

transport:
max_ssh_sessions: 5

platforms:
- name: ubuntu-16.04
driver_config:
Expand Down
3 changes: 0 additions & 3 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ driver:
http_proxy: <%= ENV['http_proxy'] || nil %>
https_proxy: <%= ENV['https_proxy'] || nil %>

transport:
max_ssh_sessions: 5

provisioner:
name: ansible_playbook
hosts: all
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :integration do
gem 'kitchen-sync'
gem 'kitchen-transport-rsync'
gem 'kitchen-docker'
gem 'inspec', '~> 3'
end

group :tools do
Expand Down
2 changes: 1 addition & 1 deletion tasks/hardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@

- name: include selinux specific tasks
include_tasks: selinux.yml
when: ansible_selinux and ansible_selinux.status != "disabled"
when: ansible_selinux and ansible_selinux.status == "enabled"
2 changes: 1 addition & 1 deletion tasks/selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
- name: install selinux policy
command: semodule -i {{ ssh_custom_selinux_dir }}/ssh_password.pp

when: not ssh_use_pam and ansible_selinux != 'Disabled' and ssh_password_module.stdout.find('ssh_password') != 0
when: not ssh_use_pam and ssh_password_module.stdout.find('ssh_password') != 0

# The following tasks only get executed when selinux is installed, UsePam is 'yes' and the ssh_password module is installed.
# See http://danwalsh.livejournal.com/12333.html for more info
Expand Down
1 change: 1 addition & 0 deletions tests/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
with_items:
- "openssh-clients"
- "openssh-server"
- "libselinux-python"
ignore_errors: true
- apt: name="{{item}}" state=present update_cache=true
with_items:
Expand Down
1 change: 1 addition & 0 deletions tests/default_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
with_items:
- "openssh-clients"
- "openssh-server"
- "libselinux-python"
ignore_errors: true
- apt: name="{{item}}" state=present update_cache=true
with_items:
Expand Down