add mosquitto to ansible

This commit is contained in:
Krispin 2024-02-09 16:49:40 +01:00
parent 047793a495
commit 817e41ebe1
7 changed files with 76 additions and 10 deletions

View File

@ -22,6 +22,9 @@ help: ## Show help for this Makefile
up: .env ## Start local dev environment with docker-compose
@docker-compose -p "${PROJECT}" up --force-recreate
down: .env ## Stop local dev environment with docker-compose
@docker-compose -p "${PROJECT}" down
ansible-requirements: ## Install ansible requirements via ansible-galaxy.
ansible-galaxy collection install -r ./ansible/requirements.yaml
ansible-galaxy role install -r ./ansible/requirements.yaml
@ -47,8 +50,11 @@ deploy: ## Deploy fabaccess with ansible.
-i "./ansible/environments/${ENVIRONMENT}" \
ansible/deploy.yaml
secrets-encrypt: ## Encrypt secrets with ansible-vault
secrets-edit: ## Edit secrets with ansible-vault.
ansible-vault edit --vault-id "${ENVIRONMENT}@prompt" "./ansible/environments/${ENVIRONMENT}/secrets.yaml"
secrets-encrypt: ## Encrypt secrets with ansible-vault.
ansible-vault encrypt --vault-id "${ENVIRONMENT}@prompt" "./ansible/environments/${ENVIRONMENT}/secrets.yaml"
secrets-decrypt: ## Decrypt secrets with ansible-vault
secrets-decrypt: ## Decrypt secrets with ansible-vault.
ansible-vault decrypt --vault-id "${ENVIRONMENT}@prompt" "./ansible/environments/${ENVIRONMENT}/secrets.yaml"

View File

@ -2,5 +2,10 @@ all:
hosts:
oklab:
ansible_connection: paramiko
ansible_user: ok
ansible_host: "{{OKLAB_HOST}}"
ansible_user: "{{OKLAB_USER}}"
ansible_become_password: "{{OKLAB_PASSWORD}}"
ansible_host: "{{OKLAB_HOST}}"
mosquitto:
hosts:
oklab:

View File

@ -1,6 +1,9 @@
$ANSIBLE_VAULT;1.2;AES256;prod
61653263353331653236653638643639386461613865636332613831643263663831393335373763
3833326161323931303962393738383364346365313365650a373766383132653539306331396634
65333138323536336432353565373064316663366363666661623939386663633232383832336261
3532616566343135300a383232356438313138396530663832383531343161626336363430343762
39326432613634346164386338386365356366316265373237316566383562663932
61313036643561666239323562303433363563386465383930646261656637663166383235636663
3263616539353535363134633034353831343834383731370a316339313861393036636263663663
34306533303231333039363031616335626338643563663037326365353838643261633366396436
6231643036653531380a613235346266353465623466306263336137633066326565373138386166
37653135313364353131393330353631646338623461663637373864306230353166303761326439
35306139663463373762646463353734323361613737666436643563313866613837643962356636
30613965653561336235393033663131366638393962663731353837393131353036613065623366
36396164623861376235

View File

@ -0,0 +1,25 @@
---
- name: reload mosquitto
become: yes
service:
name: mosquitto
state: reloaded
- name: restart mosquitto
become: yes
service:
name: mosquitto
state: restarted
- name: start mosquitto
become: yes
service:
name: mosquitto
state: started
- name: stop mosquitto
become: yes
service:
name: mosquitto
state: stopped

View File

@ -0,0 +1,19 @@
- name: Install mosquitto
become: yes
ansible.builtin.package:
name: mosquitto
state: present
- name: Copy configuration
become: yes
copy:
src: mosquitto.conf
dest: /etc/mosquitto/conf.d/mosquitto.conf
notify:
- restart mosquitto
- name: Make sure mosquitto service is running
become: yes
ansible.builtin.systemd:
state: started
name: mosquitto

View File

@ -4,4 +4,12 @@
roles:
- common
tags:
- common
- common
- name: Setup mosquitto
# gather_facts: no
hosts: mosquitto
roles:
- mosquitto
tags:
- mosquitto