rabbitmq: copy config files if missing

This commit is contained in:
Jérémy Lecour 2016-12-27 14:14:07 +01:00 committed by Jérémy Lecour
parent d4c13747f3
commit 9d70892fea
2 changed files with 9 additions and 16 deletions

View File

@ -0,0 +1,3 @@
# I am a complete /etc/rabbitmq/rabbitmq-env.conf file.
# Comment lines start with a hash character.
# This is a /bin/sh script file - use ordinary envt var syntax

View File

@ -5,24 +5,14 @@
with_items: with_items:
- rabbitmq-server - rabbitmq-server
- name: test if rabbitmq-env.conf exists - name: create rabbitmq-env.conf
stat: copy:
path: /etc/rabbitmq/rabbitmq-env.conf src: rabbitmq-env.conf
register: rabbitmq_env_file dest: /etc/rabbitmq/rabbitmq-env.conf
- name: touch rabbitmq-env.conf
file:
path: /etc/rabbitmq/rabbitmq-env.conf
owner: rabbitmq owner: rabbitmq
group: rabbitmq group: rabbitmq
mode: 0600 mode: 0600
state: touch force: no
when: not rabbitmq_env_file.stat.exists
- name: test if rabbitmq.config exists
stat:
path: /etc/rabbitmq/rabbitmq.config
register: rabbitmq_config_file
- name: create rabbitmq.config - name: create rabbitmq.config
copy: copy:
@ -31,7 +21,7 @@
owner: rabbitmq owner: rabbitmq
group: rabbitmq group: rabbitmq
mode: 0600 mode: 0600
when: not rabbitmq_config_file.stat.exists force: no
- name: set ulimit -n to 2048 - name: set ulimit -n to 2048
lineinfile: lineinfile: