Ansible script relaoed the full system demaons

370 views
Skip to first unread message

Prasanth G

unread,
Mar 15, 2017, 9:50:38 AM3/15/17
to Ansible Project
Dear Team,
there was a change happened in our environment for updating the /etc/rsyslog.conf we  executed the same via ansible playbook ( the playbook will do only 2 things , it will copy the template -new updated the rsyslog.conf and restart the deamon , but seems after the play , the whole systemd deamons reloaded and which caused the sap application restart 

and  my playbook content is like below 

we are using version ansible 2.2.1.0 and redhat 7.2 

---
- name: Copy templates/rsyslog.conf to /etc/rsyslog.conf and restart syslogd
  hosts:  all
  become: yes

  handlers:

  - name: restart-rsyslog
    service: name=rsyslog state=restarted

  tasks:

  - name: Copy the template rsyslog.conf file to /etc/rsyslog.conf
    copy: src=templates/rsyslog.conf dest=/etc/rsyslog.conf mode=0644
    notify:
    - restart-rsyslog


and the /var/log/message looks like this below 


Mar 14 19:02:44 linux0012 systemd: Starting Session 3875 of user sa-its-vcouser.
Mar 14 19:02:44 linux0012 python: ansible-setup Invoked with filter=* gather_subset=['all'] fact_path=/etc/ansible/facts.d gather_timeout=10
Mar 14 19:02:54 linux0012 python: ansible-stat Invoked with checksum_algorithm=sha1 mime=False get_checksum=True path=/etc/rsyslog.conf checksum_algo=sha1 follow=
False get_md5=False
Mar 14 19:02:55 linux0012 python: ansible-copy Invoked with src=/home/sa-its-vcouser/.ansible/tmp/ansible-tmp-1489514574.96-89549749599025/source directory_mode=N
one force=True remote_src=None unsafe_writes=None selevel=None seuser=None setype=None group=None content=NOT_LOGGING_PARAMETER dest=/etc/rsyslog.conf serole=None origi
nal_basename=rsyslog.conf delimiter=None mode=0644 regexp=None owner=None follow=False validate=None backup=False
Mar 14 19:03:12 linux0012 python: ansible-systemd Invoked with name=rsyslog enabled=None daemon_reload=False state=restarted user=False masked=None
Mar 14 19:03:12 linux0012 systemd: Stopping SAP Instance SAP12...
Mar 14 19:03:12 linux0012 systemd: Stopping SAP Oracle Database SAP12...
Mar 14 19:03:14 linux0012 sapdb.sh: Trying to stop SAP12 database ...
Mar 14 19:03:14 linux0012 sapdb.sh: Log file: /home/SAP12adm/stopdb.log
Mar 14 19:03:15 linux0012 sapinstance.sh: stopping the SAP instance G00
Mar 14 19:03:15 linux0012 sapinstance.sh: Shutdown-Log is written to /home/SAP12adm/stopsap_G00.log

Mar 14 19:03:39 linux0012systemd: Stopping SAP Instance D30...



Brian Coca

unread,
Mar 15, 2017, 11:35:30 AM3/15/17
to Ansible Project
Ansible just issued a 'systemctl restart rsyslog', systemd can be
configured in such ways that dependent services are also forced to
stop, there is nothing on the Ansible side that forces/impedes that
behaviour.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages