Skip to content

Commit

Permalink
add more when conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
blackstar257 committed Nov 8, 2019
1 parent 439d715 commit dbb395b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ This role requires Ansible 1.4 or higher.

## Role Variables

| Name | Default | Description |
| -------------- | ---------- | ------------------------------------------------- |
| selinux_policy | targeted | SELinux policy type (targeted or mls) |
| selinux_state | permissive | SELinux state (permissive, enforcing or disabled) |
| Name | Default | Description |
| --------------- | ---------- | ------------------------------------------------- |
| selinux_policy | targeted | SELinux policy type (targeted or mls) |
| selinux_state | permissive | SELinux state (permissive, enforcing or disabled) |
| selinux_relabel | true | Auto relabel files upon boot if enabled |

## Dependencies

Expand All @@ -27,7 +28,7 @@ Configure SELinux in permissive mode.
```yaml
- hosts: all
roles:
- { role: blackstar257.selinux }
- blackstar257.selinux
```
Disable SELinux
Expand All @@ -42,12 +43,11 @@ Configure SELinux to use mls policy and enforcing mode
```yaml
- hosts: all
vars:
selinux_policy: mls
selinux_state: enforcing
roles:
- {
role: blackstar257.selinux,
selinux_policy: mls,
selinux_state: enforcing,
}
- blackstar257.selinux
```
## License
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
selinux_policy: targeted
selinux_state: permissive
selinux_relabel: true
2 changes: 2 additions & 0 deletions tasks/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@
state: touch
when:
- selinux_status_change is changed
- selinux_relabel
- selinux_state != 'disabled'
tags: ["selinux"]

0 comments on commit dbb395b

Please sign in to comment.