testing passwd deployment

This commit is contained in:
Robert Kaussow 2017-12-17 13:21:46 +01:00
parent 53478a9957
commit 60f71a536c
4 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,8 @@
mosquitto_pid_file: "{{ mosquitto_pid_dir }}/mosquitto.pid"
mosquitto_user: mosquitto mosquitto_user: mosquitto
mosquitto_group: mosquitto mosquitto_group: mosquitto
mosquitto_port: 61000 mosquitto_port: 61000
mosquitto_pid_dir: /var/run mosquitto_pid_dir: /var/run
mosquitto_base_dir: /etc/mosquitto
mosquitto_config_dir: "{{ mosquitto_base_dir }}/conf.d"
mosquitto_passwd_file: "{{ mosquitto_base_dir }}/passwd"
mosquitto_pid_file: "{{ mosquitto_pid_dir }}/mosquitto.pid"

View File

@ -28,14 +28,25 @@
createhome: no createhome: no
shell: /sbin/nologin shell: /sbin/nologin
- name: Copy local configuration - name: Copy default configuration
template: template:
src: "etc/mosquitto/conf.d/local.conf.j2" src: "etc/mosquitto/conf.d/default.conf.j2"
dest: "/etc/mosquitto/conf.d/local.conf" dest: "{{ mosquitto_config_dir }}/default.conf"
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
- name: Copy passwd files
template:
src: "etc/mosquitto/passwd.j2"
dest: "{{ mosquitto_passwd_file }}"
owner: root
group: root
mode: 0600
- name: Hash passwd file
shell: "mosquitto_passwd -U {{ mosquitto_passwd_file }}"
- name: Copy systemd unit files - name: Copy systemd unit files
template: template:
src: "etc/systemd/system/mosquitto.service.j2" src: "etc/systemd/system/mosquitto.service.j2"

View File

@ -16,4 +16,4 @@ log_timestamp true
connection_messages true connection_messages true
allow_anonymous false allow_anonymous false
password_file /etc/mosquitto/passwd password_file {{ mosquitto_passwd_file }}

View File

@ -0,0 +1,2 @@
##{{ ansible_managed }}
demo:test