Skip to content

Commit

Permalink
Merge pull request #12 from hellofresh/feature/systemd-service-restart
Browse files Browse the repository at this point in the history
PT-959 Enable SSSD service autorestart
  • Loading branch information
antonu17 authored May 28, 2018
2 parents 41472e1 + 0226aca commit 77776b5
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
7 changes: 7 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion molecule/default/.yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -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/
6 changes: 3 additions & 3 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ansible==2.3.2.0
molecule
docker-py
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions tasks/sssd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 77776b5

Please sign in to comment.