Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #61 from systemli/patch-1
Browse files Browse the repository at this point in the history
Bump Integration Workflow to v1.0.0
  • Loading branch information
0x46616c6b authored May 11, 2023
2 parents 4014299 + d375e79 commit 805ed93
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 107 deletions.
5 changes: 3 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
skip_list:
- fqcn-builtins
exclude_paths:
- molecule/
- .github/
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ on:
jobs:
integration:
name: Integration
uses: systemli/github-ansible-workflow/.github/workflows/ansible-integration-workflow.yaml@main
uses: systemli/github-ansible-workflow/.github/workflows/ansible-integration-workflow.yaml@v1.0.0
with:
distros: '[ "debian11", "debian10" ]'
role-dependencies: |
- src: systemli.apt_repositories
distros: '[ "debian11" ]'
49 changes: 21 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
ansible-role-prosody
=========
# ansible-role-prosody

[![Build Status](https://github.com/systemli/ansible-role-prosody/workflows/Integration/badge.svg?branch=main)](https://github.com/systemli/ansible-role-prosody/actions?query=workflow%3AIntegration)
[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-prosody-blue.svg)](https://galaxy.ansible.com/systemli/prosody/)
[![IM observatory](https://check.messaging.one/badge.php?domain=jabber.systemli.org)](https://check.messaging.one/result.php?domain=jabber.systemli.org&type=client)
<a href='https://compliance.conversations.im/server/jabber.systemli.org'><img src='https://compliance.conversations.im/badge/jabber.systemli.org'></a>


Install and maintain [Prosody](http://prosody.im/) from official repo with Ansible.
Tested with Molecule, Docker and Vagrant.

Requirements
------------
## Requirements

Debian 10. Other versions of Debian/Ubuntu might be supported as well, but aren't tested.
Debian 11. Other versions of Debian/Ubuntu might be supported as well, but aren't tested.

Role Variables
--------------
## Role Variables

see `defaults/main.yml`

Dependencies
------------
## Dependencies

- [systemli.apt_repositories](https://galaxy.ansible.com/systemli/apt_repositories)
- [systemli.apt_repositories](https://galaxy.ansible.com/systemli/apt_repositories)

Download
--------
## Download

Download latest release with `ansible-galaxy`

ansible-galaxy install systemli.prosody
```shell
ansible-galaxy install systemli.prosody
```

Example Playbook
----------------
## Example Playbook

```
```yaml
- hosts: servers
roles:
- systemli.prosody
Expand All @@ -58,7 +52,7 @@ Look at [systemli.onion](https://github.com/systemli/ansible-role-onion).
You can also combine it with [systemli.letsencrypt](https://github.com/systemli/ansible-role-letsencrypt/) to automatically configure certs.
```
```yaml
- hosts: servers
roles:
- systemli.letsencrypt
Expand All @@ -76,13 +70,14 @@ You can also combine it with [systemli.letsencrypt](https://github.com/systemli/
renew_hook: "/usr/bin/prosodyctl --root cert import /etc/letsencrypt/live/"
```
Tests
-----
## Tests
Run local tests with
```
```shell
molecule test
```

Requires Molecule, Vagrant and `python-vagrant` to be installed.

To update vars in tests run
Expand All @@ -104,12 +99,10 @@ def j2_environment_params():
)
```

License
-------
## License

GPL

Author Information
------------------
## Author Information

https://www.systemli.org
<https://www.systemli.org>
15 changes: 7 additions & 8 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
---

- name: update lua alternatives
- name: Update lua alternatives
community.general.alternatives:
name: lua-interpreter
link: /usr/bin/lua
path: "/usr/bin/lua{{ prosody_lua_version }}"

- name: reload systemd
- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: true

- name: reload prosody config
- name: Reload prosody config
ansible.builtin.systemd:
name: prosody
state: reloaded

- name: restart prosody
- name: Restart prosody
ansible.builtin.systemd:
name: prosody
state: restarted
daemon_reload: true

- name: stop prosody
- name: Stop prosody
ansible.builtin.systemd:
name: prosody
state: stopped

- name: start prosody
- name: Start prosody
ansible.builtin.systemd:
name: prosody
state: started

- name: restart saslauthd
- name: Restart saslauthd
ansible.builtin.systemd:
name: saslauthd
state: restarted
1 change: 0 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ galaxy_info:
- name: Debian
versions:
- bullseye
- buster
dependencies:
- role: systemli.apt_repositories
vars:
Expand Down
6 changes: 6 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
roles:
- name: systemli.apt_repositories
version: 1.0.5
collections:
- name: community.general
3 changes: 1 addition & 2 deletions tasks/goss.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Check is goss test directory exists
ansible.builtin.stat:
path: "{{ goss_test_directory }}"
Expand All @@ -12,7 +11,7 @@
dest: "{{ goss_test_directory }}/test_{{ item }}.yml"
owner: root
group: root
mode: 0644
mode: "0644"
when: dir.stat is defined and dir.stat.exists and dir.stat.isdir
with_items:
- prosody
3 changes: 1 addition & 2 deletions tasks/inactive.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---

- name: Copy script to list inactive users
ansible.builtin.template:
src: prosody_inactive_users.j2
dest: /usr/local/bin/prosody_inactive_users
owner: root
group: root
mode: 0755
mode: "0755"

- name: Enable cron job to clean inactive users
ansible.builtin.cron:
Expand Down
17 changes: 8 additions & 9 deletions tasks/ldap.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

# kudos: https://blogs.mafia-server.net/nur-bahnhof/2013/12/prosody-authentification-ldapactivedirectory/
# and https://wiki.debian.org/InstallingProsody#Cyrus_SASL_with_LDAP

Expand All @@ -13,38 +12,38 @@
dest: /etc/default/saslauthd
owner: root
group: root
mode: 0644
notify: restart saslauthd
mode: "0644"
notify: Restart saslauthd

- name: Configure ldap details
ansible.builtin.template:
src: saslauthd.conf.j2
dest: /etc/saslauthd.conf
owner: root
group: root
mode: 0644
notify: restart saslauthd
mode: "0644"
notify: Restart saslauthd

- name: Create sasl directory
ansible.builtin.file:
dest: /etc/sasl
state: directory
owner: root
group: root
mode: 0755
mode: "0755"

- name: Create SASL prosody config
ansible.builtin.copy:
src: prosody.conf
dest: /etc/sasl/prosody.conf
owner: root
group: root
mode: 0644
notify: restart saslauthd
mode: "0644"
notify: Restart saslauthd

- name: Add prosody to sasl group
ansible.builtin.user:
name: prosody
groups: sasl
append: true
notify: restart prosody
notify: Restart prosody
18 changes: 11 additions & 7 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
---

- include_tasks: prosody.yml
- name: Include Prosody Tasks
ansible.builtin.include_tasks: prosody.yml
tags:
- prosody

- include_tasks: inactive.yml
- name: Include Tasks for Inactive Users Scripts
ansible.builtin.include_tasks: inactive.yml
tags:
- prosody

- include_tasks: ldap.yml
- name: Include Tasks for LDAP Authentication
ansible.builtin.include_tasks: ldap.yml
when: prosody_authentication == "cyrus"
tags:
- prosody
- ldap

- include_tasks: web.yml
when: prosody_web_dir|default(False) and prosody_web_user|default(False)
- name: Include Tasks for Web UI
ansible.builtin.include_tasks: web.yml
when: prosody_web_dir | default(False) and prosody_web_user | default(False)
tags:
- prosody
- web

- include_tasks: goss.yml
- name: Include Tasks for Goss Tests
ansible.builtin.include_tasks: goss.yml
tags:
- prosody
- goss
Loading

0 comments on commit 805ed93

Please sign in to comment.