ansible-roles/rabbitmq/tasks/main.yml
Mathieu Trossevin 7c632352a0
Replace the include module with include_tasks or import_tasks
The behaviour of the `include` module is badly defined (it try to choose
between statically importing the tasks and dynamically including them)
and can cause problems depending on any number of constraints (mostly if
it choose the wrong behaviour).

Replace it with the `import_tasks` (always statically import tasks) unless
the `include` is in a loop in which case we replace it with
`include_tasks` (always dynamically include tasks).
2023-01-03 14:43:42 +01:00

56 lines
1.1 KiB
YAML

- name: Install packages
apt:
name: rabbitmq-server
state: present
- name: Create rabbitmq-env.conf
copy:
src: evolinux-rabbitmq-env.conf
dest: /etc/rabbitmq/rabbitmq-env.conf
owner: rabbitmq
group: rabbitmq
mode: "0600"
force: no
- name: Create rabbitmq.config
copy:
src: evolinux-rabbitmq.config
dest: /etc/rabbitmq/rabbitmq.config
owner: rabbitmq
group: rabbitmq
mode: "0600"
force: no
- name: Adjust ulimit
lineinfile:
dest: /etc/default/rabbitmq-server
line: ulimit -n 2048
- name: is NRPE present ?
stat:
path: /etc/nagios/nrpe.d/evolix.cfg
check_mode: no
register: nrpe_evolix_config
tags:
- nrpe
- import_tasks: nrpe.yml
when: nrpe_evolix_config.stat.exists
- name: is Munin present ?
stat:
path: /etc/munin
check_mode: no
register: etc_munin_directory
tags:
- nrpe
- import_tasks: munin.yml
when: etc_munin_directory.stat.exists
- name: entry for RabbitMQ in web page is present
lineinfile:
dest: /var/www/index.html
insertbefore: '</ul>'
line: '<li><a href="/rabbitmq.html">RabbitMQ</a></li>'