Issue 1:
From @chriskarel on November 3, 2016 19:21

ISSUE TYPE

Bug Report

COMPONENT NAME

User module

ANSIBLE VERSION

# ansible --version
ansible 2.1.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

CONFIGURATION

Nothing unusual

OS / ENVIRONMENT

OEL/RHEL 7

SUMMARY

Using the user module on an existing user, but changing their home directory, results in the new home directory created with improper filesystem permissions and SELinux types.

STEPS TO REPRODUCE

Have an existing user, with an existing home directory setting. Then use the Ansible user module to change that home directory. The new directory will be created, but with the same permissions and SELinux values as the parent directory, rather than the usual home settings.

# cat bugtest.yaml

---
- name: Showcase bug
hosts: all
tasks:
- name: Create system accounts
user:
name={{item}}
home=/home/{{item}}
state=present
with_items:
- user_existing
- user_not_existing

# useradd -d /home/userold user_existing
# ls -lZd /home/user*
drwx------. user_existing user_existing unconfined_u:object_r:user_home_dir_t:s0 /home/userold

<run the above playbook for this host>

# ls -lZd /home/user*
drwxr-xr-x. user_existing user_existing unconfined_u:object_r:home_root_t:s0 /home/user_existing
drwx------. user_not_existing user_not_existing unconfined_u:object_r:user_home_dir_t:s0 /home/user_not_existing
drwx------. user_existing user_existing unconfined_u:object_r:user_home_dir_t:s0 /home/userold

EXPECTED RESULTS

I would expect the new home directory that is created for an existing user would have similar permissions and SELinux values as a new home directory created for a brand new user. (eg: permissions of 0700, type of user_home_dir_t)

This also impacts the .ssh directory, if generate_ssh_key is true. I would expect the .ssh directory to have ssh_home_t type, but it does not.

ACTUAL RESULTS

The new home directory inherits the parent's permissions and SELinux context. In this case, that's mode 0755 and home_root_t, the same as /home/. /home/user_existing/ should look more like /home/userold/.

# ls -lZd /home/user*
drwxr-xr-x. user_existing user_existing unconfined_u:object_r:home_root_t:s0 /home/user_existing
drwx------. user_not_existing user_not_existing unconfined_u:object_r:user_home_dir_t:s0 /home/user_not_existing
drw-------. user_existing user_existing unconfined_u:object_r:user_home_dir_t:s0 /home/userold

Copied from original issue: ansible/ansible-modules-core#5481

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

route53 module

ANSIBLE VERSION

ansible 2.2.3.0

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

When you have "duplicate" hosted zones in route53 and use command=get and the hosted_zone_id parameter, it gets ignored when looking up the nameservers for the zone. For some reason, instead of using the zone object that was already looked up (using the module's get_zone_by_name() function), a separate lookup is done using only the name (using the boto conn.get_zone() function), which ends up getting the wrong zone in this corner case.

The fix should be relatively simple. Instead of doing another lookup for the zone, the existing zone var should just be used for the .get_nameservers() call.

ansible/lib/ansible/modules/cloud/amazon/route53.py

Line 583
in
74f6b64

z = invoke_with_throttling_retries(conn.get_zone, zone_in)

STEPS TO REPRODUCE

N/A

EXPECTED RESULTS

N/A

ACTUAL RESULTS

N/A