From 357496768d662880273dbf2ecdf58eebb948d86c Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 4 Nov 2018 23:21:13 +0100 Subject: [PATCH] install only for debug --- defaults/main.yml | 1 + handlers/main.yml | 3 +- tasks/install.yml | 72 +++++++++++++++++++++++++---------------------- tasks/main.yml | 4 +-- 4 files changed, 42 insertions(+), 38 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1908850..1985142 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,4 @@ +--- mosquitto_user: mosquitto mosquitto_group: mosquitto mosquitto_port: 1883 diff --git a/handlers/main.yml b/handlers/main.yml index 7ed3a61..8667896 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -5,5 +5,4 @@ daemon_reload: yes name: mosquitto enabled: yes - listen: - - "mosquitto_restart" + listen: __mosquitto_restart diff --git a/tasks/install.yml b/tasks/install.yml index 575c549..d666bcd 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,39 +1,43 @@ --- -- name: Add mttq repository - yum_repository: - name: mttq - file: mttq - description: MTTQ Broker - baseurl: "http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-{{ ansible_distribution_major_version }}/" - gpgkey: "http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-{{ ansible_distribution_major_version }}/repodata/repomd.xml.key" +- block: + - name: Add mttq repository + yum_repository: + name: mttq + file: Mosquitto + description: MTTQ Broker + baseurl: "https://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-{{ ansible_distribution_major_version }}/" + gpgkey: "https://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-{{ ansible_distribution_major_version }}/repodata/repomd.xml.key" + gpgcheck: yes + enabled: yes -- name: Install mttq packages - yum: - name: "{{ item }}" - state: installed - with_items: - - mosquitto - - mosquitto-clients + - name: Install mttq packages + yum: + name: "{{ item }}" + state: present + with_items: + - mosquitto + - mosquitto-clients -- name: Create group '{{ mosquitto_group }}' - group: - name: '{{ mosquitto_group }}' - state: present + # - name: Create group '{{ mosquitto_group }}' + # group: + # name: '{{ mosquitto_group }}' + # state: present -- name: Create user '{{ mosquitto_user }}' - user: - name: '{{ mosquitto_user }}' - group: '{{ mosquitto_group }}' - system: yes - createhome: no - shell: /sbin/nologin + # - name: Create user '{{ mosquitto_user }}' + # user: + # name: '{{ mosquitto_user }}' + # group: '{{ mosquitto_group }}' + # system: yes + # createhome: no + # shell: /sbin/nologin -- name: Copy default configuration - template: - src: "etc/mosquitto/conf.d/default.conf.j2" - dest: "{{ mosquitto_config_dir }}/default.conf" - owner: root - group: root - mode: 0644 - notify: - - mosquitto_restart + # - name: Copy default configuration + # template: + # src: "etc/mosquitto/conf.d/default.conf.j2" + # dest: "{{ mosquitto_config_dir }}/default.conf" + # owner: root + # group: root + # mode: 0644 + # notify: __mosquitto_restart + become: True + become_user: root diff --git a/tasks/main.yml b/tasks/main.yml index 1869ca1..e638c58 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,3 @@ --- -- include_tasks: install.yml -- include_tasks: config.yml +- import_tasks: install.yml +# - import_tasks: config.yml