-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmosquitto-clients.yml
56 lines (50 loc) · 1.59 KB
/
mosquitto-clients.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
#
# Ansible playbook: install Mosquitto Clients v201503190029
# Louis T. Getterman IV (@LTGIV)
# www.GotGetLLC.com / www.opensour.cc/ggcom/ansible/playbooks/mosquitto-clients
#
# Example Usage:
# [user@host ~$] ansible-playbook ~/ggcom/ggcom-ansible-playbooks/mosquitto-clients.yml --extra-vars 'target=nameFromHostsFile'
#
# Thanks:
# http://mosquitto.org/2013/01/mosquitto-debian-repository/
- hosts: '{{ target }}'
sudo: yes
tasks:
#---------- Add repository to system
#----- Debian
- name: Add Mosquitto repository for Debian
apt_repository: >
repo='{{ item }}'
state=present
with_items:
- 'http://repo.mosquitto.org/debian/mosquitto-{{ ansible_lsb.codename }}.list'
when: ansible_distribution == 'Debian'
#-----/Debian
#----- Ubuntu
- name: Add Mosquitto repository for Ubuntu
apt_repository: >
repo='{{ item }}'
state=present
with_items:
- 'ppa:mosquitto-dev/mosquitto-ppa'
when: ansible_distribution == 'Ubuntu'
#-----/Ubuntu
#----------/Add repository to system
#---------- Add repository's key to system
- name: Add Mosquitto key
apt_key: >
url='http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key'
state=present
#----------/Add repository's key to system
#---------- Install Mosquitto Client and Python Module
- name: Install Mosquitto Clients, and API
apt: >
update_cache=yes
pkg={{ item }}
state=installed
with_items:
- mosquitto-clients
- python-mosquitto
#----------/Install Mosquitto Client and Python Module