Skip to content

selinux module removes newlines in 2.4.0.0 #30618

@mattwillsher

Description

@mattwillsher
ISSUE TYPE
  • Bug Report
COMPONENT NAME

selinux

ANSIBLE VERSION
ansible 2.4.0.0
CONFIGURATION
ANSIBLE_SSH_PIPELINING(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = True
CACHE_PLUGIN(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = facts
CACHE_PLUGIN_TIMEOUT(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = 600
DEFAULT_GATHERING(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = smart
DEFAULT_HOST_LIST(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = [u'/Users/mwillsher/src/cloud-deployment/ansible-playbooks/inventory/aws']
DEFAULT_ROLES_PATH(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = [u'/Users/mwillsher/src/cloud-deployment/ansible-playbooks/roles', u'/Users/mwillsher/sr
DISPLAY_SKIPPED_HOSTS(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = False
HOST_KEY_CHECKING(/Users/mwillsher/src/cloud-deployment/ansible-playbooks/ansible.cfg) = False
OS / ENVIRONMENT

MacOS running Ansible
CentOS 6 target

SUMMARY

selinux module strips newlines from /etc/sysconfig/selinux

STEPS TO REPRODUCE

Before

[root@ip-10-100-151-172 ~]# more /etc/sysconfig/selinux
~
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
ansible -m selinux -a "state=disabled" IP -vvv -u root -i inventory/aws/ec2.py

After

# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:#     enforcing - SELinux security policy is enforced.#     permissive - SELinux prints warnings instead of enforcing.#     disabled - No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of these two values:#     targeted - Targeted processes are protected,#     mls - Multi Level Security protection.SELINUXTYPE=targeted
EXPECTED RESULTS

Valuse changed in file and EOL chars left intact.

ACTUAL RESULTS

New lines removed, file invalid.

Metadata

Metadata

Assignees

Labels

P2Priority 2 - Issue Blocks Releaseaffects_2.4This issue/PR affects Ansible v2.4bugThis issue/PR relates to a bug.moduleThis issue/PR relates to a module.support:coreThis issue/PR relates to code supported by the Ansible Engineering Team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions