It's always systemd. Remove references to upstart

Upstart was last seen on ubuntu-14

Change-Id: I5cfbcc10fd1fbb76e5606e3f550327c4c8f3ff45
This commit is contained in:
Erik Berg 2021-03-06 00:49:10 +01:00
parent 16782bf43b
commit ae879fc6e6
19 changed files with 23 additions and 248 deletions

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart apm-server (systemd)
- name: Enable and restart apm-server
systemd:
name: "apm-server"
enabled: true
state: restarted
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart apm server
- name: Enable and restart apm-server (upstart)
service:
name: "apm-server"
state: restarted
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart apm server

View File

@ -35,7 +35,7 @@
retries: 3
delay: 2
notify:
- Enable and restart apm server
- Enable and restart apm-server
tags:
- package_install
@ -46,28 +46,24 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "/etc/systemd/system/apm-server.service.d/{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "apm-server-overrides.conf"
notify:
- Enable and restart apm server
- Enable and restart apm-server
- name: Drop apm-server conf file
template:
src: "apm-server.yml.j2"
dest: "/etc/apm-server/apm-server.yml"
notify:
- Enable and restart apm server
- Enable and restart apm-server
- name: Run the beat setup role
include_role:

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart auditbeat (systemd)
- name: Enable and restart auditbeat
systemd:
name: "auditbeat"
enabled: true
state: "{{ auditbeat_service_state }}"
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart auditbeat
- name: Enable and restart auditbeat (upstart)
service:
name: "auditbeat"
state: "{{ auditbeat_service_state }}"
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart auditbeat

View File

@ -54,16 +54,12 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "/etc/systemd/system/auditbeat.service.d/{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "auditbeat-overrides.conf"
@ -92,20 +88,10 @@
- name: Force beat handlers
meta: flush_handlers
- name: set auditbeat service state (upstart)
service:
name: "auditbeat"
state: "{{ auditbeat_service_state }}"
enabled: "{{ auditbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'upstart'
- auditbeat_service_state in ['started', 'stopped']
- name: set auditbeat service state (systemd)
- name: set auditbeat service state
systemd:
name: "auditbeat"
state: "{{ auditbeat_service_state }}"
enabled: "{{ auditbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'systemd'
- auditbeat_service_state in ['started', 'stopped']

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart filebeat (systemd)
- name: Enable and restart filebeat
systemd:
name: "filebeat"
enabled: true
state: "{{ filebeat_service_state }}"
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart filebeat
- name: Enable and restart filebeat (upstart)
service:
name: "filebeat"
state: "{{ filebeat_service_state }}"
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart filebeat

View File

@ -46,16 +46,12 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "/etc/systemd/system/filebeat.service.d/{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "filebeat-overrides.conf"
@ -95,20 +91,10 @@
- name: Force beat handlers
meta: flush_handlers
- name: set filebeat service state (upstart)
service:
name: "filebeat"
state: "{{ filebeat_service_state }}"
enabled: "{{ filebeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'upstart'
- filebeat_service_state in ['started', 'stopped']
- name: set filebeat service state (systemd)
- name: set filebeat service state
systemd:
name: "filebeat"
state: "{{ filebeat_service_state }}"
enabled: "{{ filebeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'systemd'
- filebeat_service_state in ['started', 'stopped']

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart heartbeat (systemd)
- name: Enable and restart heartbeat
systemd:
name: "heartbeat-elastic"
enabled: true
state: "{{ heartbeat_service_state }}"
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart heartbeat
- name: Enable and restart heartbeat (upstart)
service:
name: "heartbeat-elastic"
state: "{{ heartbeat_service_state }}"
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart heartbeat

View File

@ -46,16 +46,12 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "/etc/systemd/system/heartbeat.service.d/heartbeat-overrides.conf"
@ -67,8 +63,6 @@
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "heartbeat.yml.j2"
dest: "/etc/heartbeat/heartbeat.yml"
@ -90,20 +84,10 @@
- name: Force beat handlers
meta: flush_handlers
- name: set heartbeat service state (upstart)
service:
name: "heartbeat-elastic"
state: "{{ heartbeat_service_state }}"
enabled: "{{ heartbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'upstart'
- heartbeat_service_state in ['started', 'stopped']
- name: set heartbeat service state (systemd)
systemd:
name: "heartbeat-elastic"
state: "{{ heartbeat_service_state }}"
enabled: "{{ heartbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'systemd'
- heartbeat_service_state in ['started', 'stopped']

View File

@ -102,20 +102,10 @@
- name: Force beat handlers
meta: flush_handlers
- name: set journalbeat service state (upstart)
service:
name: "journalbeat"
state: "{{ journalbeat_service_state }}"
enabled: "{{ journalbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'upstart'
- journalbeat_service_state in ['started', 'stopped']
- name: set journalbeat service state (systemd)
systemd:
name: "journalbeat"
state: "{{ journalbeat_service_state }}"
enabled: "{{ journalbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'systemd'
- journalbeat_service_state in ['started', 'stopped']

View File

@ -13,27 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart services (systemd)
- name: Enable and restart kibana services
systemd:
name: "{{ item }}"
enabled: true
state: restarted
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
with_items:
- nginx
- kibana
listen: Enable and restart services
- name: Enable and restart services (upstart)
service:
name: "{{ item }}"
state: restarted
enabled: yes
when:
- ansible_service_mgr == 'upstart'
with_items:
- nginx
- kibana
listen: Enable and restart services

View File

@ -35,7 +35,7 @@
retries: 3
delay: 2
notify:
- Enable and restart services
- Enable and restart kibana services
tags:
- package_install
@ -54,7 +54,7 @@
src: "nginx_default.j2"
dest: "{{ kibana_nginx_vhost_path }}/default"
notify:
- Enable and restart services
- Enable and restart kibana services
- name: Create kibana systemd service config dir
file:
@ -63,21 +63,17 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "/etc/systemd/system/kibana.service.d/kibana-overrides.conf"
notify:
- Enable and restart services
- Enable and restart kibana services
- name: Drop kibana conf file
template:
@ -85,4 +81,4 @@
dest: "/etc/kibana/kibana.yml"
mode: "0666"
notify:
- Enable and restart services
- Enable and restart kibana services

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart logstash (systemd)
- name: Enable and restart logstash
systemd:
name: "logstash"
enabled: true
state: "restarted"
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart logstash
- name: Enable and restart logstash (upstart)
service:
name: "logstash"
state: "restarted"
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart logstash

View File

@ -65,16 +65,12 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "/etc/systemd/system/logstash.service.d/logstash-overrides.conf"
@ -137,15 +133,11 @@
command: id -u logstash
register: logstash_uid
changed_when: false
when:
- ansible_service_mgr == 'systemd'
- name: Get logstash GID
command: id -g logstash
register: logstash_gid
changed_when: false
when:
- ansible_service_mgr == 'systemd'
- name: Read logstash queue path
command: "readlink -f /var/lib/logstash/queue"
@ -166,18 +158,6 @@
- logstash.service
state: 'started'
enabled: true
when:
- ansible_service_mgr == 'systemd'
- name: Apply fstab options for memory queues
mount:
path: "{{ logstash_queue_path.stdout.strip() }}"
src: tmpfs
fstype: tmpfs
opts: size={{ (elastic_memory_lower_limit | int) // 2 }}m
state: mounted
when:
- ansible_service_mgr != 'systemd'
when:
- logstash_queue_type == 'memory'

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart metricbeat (systemd)
- name: Enable and restart metricbeat
systemd:
name: "metricbeat"
enabled: true
state: "{{ metricbeat_service_state }}"
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart metricbeat
- name: Enable and restart metricbeat (upstart)
service:
name: "metricbeat"
state: "{{ metricbeat_service_state }}"
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart metricbeat

View File

@ -268,16 +268,12 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "/etc/systemd/system/metricbeat.service.d/metricbeat-overrides.conf"
@ -310,20 +306,10 @@
- name: Force beat handlers
meta: flush_handlers
- name: set metricbeat service state (upstart)
service:
name: "metricbeat"
state: "{{ metricbeat_service_state }}"
enabled: "{{ metricbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'upstart'
- metricbeat_service_state in ['started', 'stopped']
- name: set metricbeat service state (systemd)
systemd:
name: "metricbeat"
state: "{{ metricbeat_service_state }}"
enabled: "{{ metricbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'systemd'
- metricbeat_service_state in ['started', 'stopped']

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart packetbeat (systemd)
- name: Enable and restart packetbeat
systemd:
name: "packetbeat"
enabled: true
state: "{{ packetbeat_service_state }}"
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart packetbeat
- name: Enable and restart packetbeat (upstart)
service:
name: "packetbeat"
state: "{{ packetbeat_service_state }}"
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart packetbeat

View File

@ -46,16 +46,12 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0644"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.general-overrides.conf.j2"
dest: "/etc/systemd/system/packetbeat.service.d/packetbeat-overrides.conf"
@ -88,20 +84,10 @@
- name: Force beat handlers
meta: flush_handlers
- name: set packetbeat service state (upstart)
service:
name: "packetbeat"
state: "{{ packetbeat_service_state }}"
enabled: "{{ packetbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'upstart'
- packetbeat_service_state in ['started', 'stopped']
- name: set packetbeat service state (systemd)
- name: set packetbeat service state
systemd:
name: "packetbeat"
state: "{{ packetbeat_service_state }}"
enabled: "{{ packetbeat_service_state in ['running', 'started', 'restarted'] }}"
when:
- ansible_service_mgr == 'systemd'
- packetbeat_service_state in ['started', 'stopped']

View File

@ -13,21 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable and restart elasticsearch (systemd)
- name: Enable and restart elasticsearch
systemd:
name: "elasticsearch"
enabled: true
state: restarted
daemon_reload: true
when:
- ansible_service_mgr == 'systemd'
listen: Enable and restart elastic
- name: Enable and restart elasticsearch (upstart)
service:
name: "elasticsearch"
state: restarted
enabled: yes
when:
- ansible_service_mgr == 'upstart'
listen: Enable and restart elastic

View File

@ -40,7 +40,7 @@
retries: 3
delay: 2
notify:
- Enable and restart elastic
- Enable and restart elasticsearch
tags:
- package_install
@ -51,20 +51,16 @@
group: "root"
owner: "root"
mode: "0755"
when:
- ansible_service_mgr == 'systemd'
- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
when:
- ansible_service_mgr == 'systemd'
with_items:
- src: "systemd.elasticsearch-overrides.conf.j2"
dest: "/etc/systemd/system/elasticsearch.service.d/elasticsearch-overrides.conf"
notify:
- Enable and restart elastic
- Enable and restart elasticsearch
tags:
- config
@ -95,7 +91,7 @@
- src: "jvm.options.j2"
dest: "/etc/elasticsearch/jvm.options"
notify:
- Enable and restart elastic
- Enable and restart elasticsearch
- name: Drop elasticsearch conf file
template:
@ -107,7 +103,7 @@
- src: "es-log4j2.properties.j2"
dest: "/etc/elasticsearch/log4j2.properties"
notify:
- Enable and restart elastic
- Enable and restart elasticsearch
tags:
- config