Skip to content

Commit 77776b5

Browse files
authored
Merge pull request #12 from hellofresh/feature/systemd-service-restart
PT-959 Enable SSSD service autorestart
2 parents 41472e1 + 0226aca commit 77776b5

File tree

6 files changed

+32
-5
lines changed

6 files changed

+32
-5
lines changed

handlers/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@
3030
service:
3131
name: "{{ sssd_ldap_ssh_service }}"
3232
state: restarted
33+
34+
- name: reload systemd config
35+
systemd:
36+
name: sssd
37+
state: restarted
38+
daemon_reload: yes
39+
when: ansible_distribution_release != 'trusty'

molecule/default/.yamllint

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ rules:
1010
line-length: disable
1111
# NOTE(retr0h): Templates no longer fail this lint rule.
1212
# Uncomment if running old Molecule templates.
13-
# truthy: disable
13+
truthy: disable
1414
ignore: |
1515
venv/
16+
.molecule/

molecule/default/molecule.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ platforms:
1111
- name: ubuntu-trusty
1212
image: ubuntu-upstart
1313
command: /sbin/init
14-
privileged: 'true'
14+
privileged: True
1515
links:
1616
- "openldap:openldap"
1717
- name: ubuntu-xenial
1818
image: solita/ubuntu-systemd
1919
command: /sbin/init
20-
privileged: 'true'
20+
privileged: True
2121
capabilities:
2222
- SYS_ADMIN
2323
volumes:
@@ -27,7 +27,7 @@ platforms:
2727
- name: centos-7
2828
image: centos/systemd
2929
command: /usr/sbin/init
30-
privileged: 'true'
30+
privileged: True
3131
volumes:
3232
- /sys/fs/cgroup:/sys/fs/cgroup:ro
3333
capabilities:

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ansible==2.3.2.0
2+
molecule
3+
docker-py

run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ then
6161
fi
6262
virtualenv venv
6363
. ./venv/bin/activate
64-
pip install ansible docker-py molecule
64+
pip install -r requirements.txt
6565

6666
echo "Run molecule tests"
6767
molecule test

tasks/sssd.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
notify:
1111
- restart sssd
1212

13+
- name: update systemd service unit
14+
ini_file:
15+
path: /lib/systemd/system/sssd.service
16+
section: "{{ item.section }}"
17+
option: "{{ item.option }}"
18+
value: "{{ item.value }}"
19+
no_extra_spaces: yes
20+
with_items:
21+
- section: Service
22+
option: ExecStartPre
23+
value: "/bin/rm -rf /var/run/sssd.pid || true"
24+
- section: Service
25+
option: Restart
26+
value: always
27+
notify: reload systemd config
28+
1329
- name: sssd | ensure sssd service is enabled
1430
service:
1531
name: sssd

0 commit comments

Comments
 (0)