Merge "Use the systemd module"

This commit is contained in:
Zuul 2018-08-01 19:28:00 +00:00 committed by Gerrit Code Review
commit d368ea3637
17 changed files with 85 additions and 51 deletions

View File

@ -27,5 +27,6 @@
backup: true
- name: Reload haproxy
become: true
command: systemctl reload haproxy
systemd:
name: haproxy
state: reloaded

View File

@ -14,5 +14,6 @@
backup: true
- name: Restart httpd
become: true
command: systemctl restart httpd
systemd:
name: httpd
state: restarted

View File

@ -18,13 +18,15 @@
- "{{ceilometer_configuration}}"
- name: (Newton, Ocata) Restart Ceilometer Agent Notification
become: true
command: systemctl restart openstack-ceilometer-notification
systemd:
name: openstack-ceilometer-notification
state: restarted
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode) and (restart_notification)"
- name: (Newton, Ocata) Restart Ceilometer Collector
become: true
command: systemctl restart openstack-ceilometer-collector
systemd:
name: openstack-ceilometer-collector
state: restarted
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode) and (restart_collector)"
- name: (Pike) Restart Ceilometer Agent Notification

View File

@ -20,8 +20,9 @@
backup: true
- name: (Newton, Ocata) Restart Gnocchi API (httpd)
become: true
command: systemctl restart httpd
systemd:
name: httpd
state: restarted
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode)"
- name: (Pike) Restart Gnocchi API (httpd)

View File

@ -18,8 +18,9 @@
- "{{gnocchi_configuration}}"
- name: (Newton, Ocata) Restart Gnocchi Metricd
become: true
command: systemctl restart openstack-gnocchi-metricd
systemd:
name: openstack-gnocchi-metricd
state: restarted
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode)"
- name: (Pike) Restart Gnocchi Metricd

View File

@ -43,5 +43,6 @@
command: systemctl daemon-reload
- name: Restart virtlogd
become: true
command: systemctl restart virtlogd
systemd:
name: virtlogd
state: restarted

View File

@ -38,7 +38,8 @@
when: "('Pike' in osp_version['content'] | b64decode) and ('compute' in group_names)"
- name: Stopping Ceilometer Polling Daemon
become: true
command: "systemctl stop {{item}}"
systemd:
name: "{{ item }}"
state: stopped
with_items:
- "{{polling_daemon}}"

View File

@ -82,14 +82,16 @@
when: "'controller' in group_names"
- name: Stopping Telemetry Controller Services
become: true
command: "systemctl stop {{item}}"
systemd:
name: "{{ item }}"
state: stopped
with_items: "{{controller_services}}"
when: "'controller' in group_names"
- name: Stopping Telemetry Compute Services
become: true
command: "systemctl stop {{item}}"
systemd:
name: "{{ item }}"
state: stopped
with_items: "{{compute_services}}"
when: "'compute' in group_names"
@ -131,8 +133,9 @@
when: "'controller' in group_names"
- name: Restart Controller Services to disable notifications
become: true
command: "systemctl restart {{item}}"
systemd:
name: "{{ item }}"
state: restarted
with_items:
- openstack-cinder-scheduler.service
- openstack-glance-api.service
@ -145,6 +148,7 @@
when: "'controller' in group_names"
- name: Restart Nova Compute Service to disable notifications
become: true
command: "systemctl restart openstack-nova-compute.service"
systemd:
name: openstack-nova-compute.service
state: restarted
when: "'compute' in group_names"

View File

@ -82,14 +82,16 @@
when: "'controller' in group_names"
- name: Starting Telemetry Controller Services
become: true
command: "systemctl start {{item}}"
systemd:
name: "{{ item }}"
state: started
with_items: "{{controller_services}}"
when: "'controller' in group_names"
- name: Starting Telemetry Compute Service(s)
become: true
command: "systemctl start {{item}}"
systemd:
name: "{{ item }}"
state: started
with_items: "{{compute_services}}"
when: "'compute' in group_names"
@ -136,8 +138,9 @@
when: "'controller' in group_names"
- name: Restart Controller Services to enable notifications
become: true
command: "systemctl restart {{item}}"
systemd:
name: "{{ item }}"
state: restarted
with_items:
- openstack-cinder-scheduler.service
- openstack-glance-api.service
@ -150,6 +153,7 @@
when: "'controller' in group_names"
- name: Restart Nova Compute Services to enable notifications
become: true
command: "systemctl restart openstack-nova-compute.service"
systemd:
name: openstack-nova-compute.service
state: restarted
when: "'compute' in group_names"

View File

@ -117,7 +117,9 @@
become: true
- name: Start elasticsearch service
command: systemctl start elasticsearch.service
systemd:
name: elasticsearch.service
state: started
ignore_errors: true
when: elasticsearch_updated != 0

View File

@ -52,9 +52,9 @@
when: ((elk_client_ssl_cert_exists != 0) and (logging_backend != 'fluentd'))
- name: Start filebeat service
command: systemctl start filebeat.service
ignore_errors: true
become: true
systemd:
name: filebeat.service
state: started
when: ((filebeat_needs_restart != 0) and (logging_backend != 'fluentd'))
- name: Setup filebeat service
@ -88,7 +88,7 @@
when: (logging_backend == 'fluentd')
- name: Restarting rsyslog for fluentd
become: true
command: systemctl restart rsyslog.service
ignore_errors: true
systemd:
name: rsyslog.service
state: restarted
when: rsyslog_updated != 0

View File

@ -194,7 +194,9 @@
become: true
- name: Start fluentd service
command: systemctl start td-agent.service
systemd:
name: td-agent.service
state: started
ignore_errors: true
when: fluentd_needs_restart != 0

View File

@ -120,7 +120,9 @@
register: iptables_needs_restart
- name: (grafana) Restart iptables-services for TCP/{{grafana_port}} (iptables-services)
command: systemctl restart iptables.service
systemd:
name: iptables.service
state: restarted
ignore_errors: true
when: iptables_needs_restart != 0 and firewalld_in_use.rc != 0 and firewalld_is_active.rc != 0

View File

@ -132,7 +132,9 @@
register: iptables_needs_restart
- name: (graphite-web) Restart iptables-services for TCP/{{graphite_port}} (iptables-services)
shell: systemctl restart iptables.service
systemd:
name: iptables.service
state: restarted
ignore_errors: true
when: iptables_needs_restart != 0 and firewalld_in_use.rc != 0 and firewalld_is_active.rc != 0

View File

@ -41,7 +41,9 @@
register: rsyslog_updated
- name: Populate elasticsearch index with local logs via fluentd
command: systemctl restart rsyslog.service
systemd:
name: rsyslog.service
state: restarted
ignore_errors: true
when: rsyslog_updated != 0
@ -125,13 +127,16 @@
when: filebeat_forwarder_ssl_client_copy_exists != 0
- name: Refresh logstash service
command: systemctl restart logstash.service
systemd:
name: logstash.service
state: restarted
ignore_errors: true
when: (logging_backend != 'fluentd')
become: true
- name: Refresh fluentd service
command: systemctl restart td-agent.service
systemd:
name: td-agent.service
state: restarted
when: (logging_backend == 'fluentd')
become: true

View File

@ -46,7 +46,9 @@
# start nginx service
- name: Start nginx service
command: systemctl restart nginx.service
systemd:
name: nginx.service
state: restarted
ignore_errors: true
when: nginx_needs_restart != 0
@ -60,8 +62,9 @@
- skip_ansible_lint
- name: Set nginx to start on boot
command: systemctl enable nginx.service
ignore_errors: true
systemd:
name: nginx.service
enabled: yes
when: nginx_in_use.rc != 0
# we need TCP/80 and TCP/8080 open

View File

@ -25,5 +25,7 @@
become: True
- name: bounce systemd and setup StatsD to run on startup
shell: /usr/bin/systemctl daemon-reload && /usr/bin/systemctl enable statsd && /usr/bin/systemctl restart statsd
become: True
systemd:
name: statsd
enabled: yes
state: restarted