Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selinux module removes newlines in 2.4.0.0 #30618

Closed
mattwillsher opened this issue Sep 20, 2017 · 1 comment · Fixed by #31251
Closed

selinux module removes newlines in 2.4.0.0 #30618

mattwillsher opened this issue Sep 20, 2017 · 1 comment · Fixed by #31251
Assignees
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. P2 Priority 2 - Issue Blocks Release support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@mattwillsher
Copy link
Contributor

mattwillsher commented Sep 20, 2017

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.

@mattwillsher mattwillsher changed the title selinux module removes newlines selinux module removes newlines in 2.4.0.0 Sep 20, 2017
@ansibot
Copy link
Contributor

ansibot commented Sep 20, 2017

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 20, 2017
@samdoran samdoran self-assigned this Sep 21, 2017
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Sep 21, 2017
@samdoran samdoran added this to Nominated in 2.4.x Blocker List Oct 2, 2017
@samdoran samdoran moved this from Nominated to TODO: Blocker in 2.4.x Blocker List Oct 3, 2017
@samdoran samdoran moved this from TODO: Blocker to In Progress in 2.4.x Blocker List Oct 3, 2017
@samdoran samdoran added the P2 Priority 2 - Issue Blocks Release label Oct 3, 2017
@samdoran samdoran moved this from In Progress to TODO: Blocker in 2.4.x Blocker List Oct 4, 2017
@samdoran samdoran moved this from TODO: Blocker to Done in 2.4.x Blocker List Oct 4, 2017
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. P2 Priority 2 - Issue Blocks Release support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
No open projects
2.4.x Blocker List
Done in 2.4.1
Development

Successfully merging a pull request may close this issue.

3 participants