diff --git a/handlers/main.yml b/handlers/main.yml index b5e7d9d..361f920 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -30,3 +30,10 @@ service: name: "{{ sssd_ldap_ssh_service }}" state: restarted + +- name: reload systemd config + systemd: + name: sssd + state: restarted + daemon_reload: yes + when: ansible_distribution_release != 'trusty' diff --git a/molecule/default/.yamllint b/molecule/default/.yamllint index 1e57c76..0f76e58 100644 --- a/molecule/default/.yamllint +++ b/molecule/default/.yamllint @@ -10,6 +10,7 @@ rules: line-length: disable # NOTE(retr0h): Templates no longer fail this lint rule. # Uncomment if running old Molecule templates. - # truthy: disable + truthy: disable ignore: | venv/ + .molecule/ diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 6553700..bddbf42 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -11,13 +11,13 @@ platforms: - name: ubuntu-trusty image: ubuntu-upstart command: /sbin/init - privileged: 'true' + privileged: True links: - "openldap:openldap" - name: ubuntu-xenial image: solita/ubuntu-systemd command: /sbin/init - privileged: 'true' + privileged: True capabilities: - SYS_ADMIN volumes: @@ -27,7 +27,7 @@ platforms: - name: centos-7 image: centos/systemd command: /usr/sbin/init - privileged: 'true' + privileged: True volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro capabilities: diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7715ca5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +ansible==2.3.2.0 +molecule +docker-py diff --git a/run_tests.sh b/run_tests.sh index df9cddb..055f96b 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -61,7 +61,7 @@ then fi virtualenv venv . ./venv/bin/activate -pip install ansible docker-py molecule +pip install -r requirements.txt echo "Run molecule tests" molecule test diff --git a/tasks/sssd.yml b/tasks/sssd.yml index 21c069c..5e848ec 100644 --- a/tasks/sssd.yml +++ b/tasks/sssd.yml @@ -10,6 +10,22 @@ notify: - restart sssd +- name: update systemd service unit + ini_file: + path: /lib/systemd/system/sssd.service + section: "{{ item.section }}" + option: "{{ item.option }}" + value: "{{ item.value }}" + no_extra_spaces: yes + with_items: + - section: Service + option: ExecStartPre + value: "/bin/rm -rf /var/run/sssd.pid || true" + - section: Service + option: Restart + value: always + notify: reload systemd config + - name: sssd | ensure sssd service is enabled service: name: sssd