Skip to content

Commit 079ee08

Browse files
authored
Merge pull request #51 from codingteam/ansible
Enable Ansible deployment for xmpp2 host
2 parents cb5855f + 3a6089f commit 079ee08

26 files changed

+615
-0
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ on:
1414
workflow_dispatch:
1515

1616
jobs:
17+
lint:
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- name: Check out the repository
21+
uses: actions/checkout@v4
22+
- name: Run ansible-lint
23+
uses: ansible/ansible-lint@v25
24+
with:
25+
args: "-c ansible-lint.yml"
26+
1727
encoding:
1828
runs-on: ubuntu-24.04
1929
steps:

Folder.DotSettings

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/UserDictionary/Words/=certonly/@EntryIndexedValue">True</s:Boolean>
3+
<s:Boolean x:Key="/Default/UserDictionary/Words/=codingteam/@EntryIndexedValue">True</s:Boolean>
4+
<s:Boolean x:Key="/Default/UserDictionary/Words/=lineinfile/@EntryIndexedValue">True</s:Boolean>
5+
<s:Boolean x:Key="/Default/UserDictionary/Words/=loglist/@EntryIndexedValue">True</s:Boolean>
6+
<s:Boolean x:Key="/Default/UserDictionary/Words/=pgdata/@EntryIndexedValue">True</s:Boolean>
7+
<s:Boolean x:Key="/Default/UserDictionary/Words/=postgre/@EntryIndexedValue">True</s:Boolean>
8+
<s:Boolean x:Key="/Default/UserDictionary/Words/=sshuser/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Host specification
2525
- [codingteam.org.ru][hosts/ctor]
2626
- [cthulhu-3][hosts/cthulhu-3]
2727
- [omnissiah][hosts/omnissiah]
28+
- [xmpp2][hosts.xmpp2]
2829

2930
Documentation
3031
-------------
@@ -41,6 +42,7 @@ The license indication in the project's sources is compliant with the [REUSE spe
4142
[devops]: https://ru.wikipedia.org/wiki/DevOps
4243
[docs.contributing]: CONTRIBUTING.md
4344
[docs.license]: LICENSES/MIT.txt
45+
[host.xmpp2]: xmpp2/README.md
4446
[hosts/cthulhu-3]: cthulhu-3/Host.md
4547
[hosts/ctor]: ctor/Host.md
4648
[hosts/omnissiah]: omnissiah/Host.md

REUSE.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version = 1
2+
SPDX-PackageName = "devops"
3+
SPDX-PackageSupplier = "codingteam/devops contributors <https://github.com/codingteam/devops>"
4+
SPDX-PackageDownloadLocation = "https://github.com/codingteam/devops"
5+
6+
[[annotations]]
7+
path = "**.DotSettings"
8+
precedence = "aggregate"
9+
SPDX-FileCopyrightText = "2025 Friedrich von Never <[email protected]>"
10+
SPDX-License-Identifier = "MIT"

ansible-lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-FileCopyrightText: 2025 Friedrich von Never <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
exclude_paths:
6+
- .github/ # no Ansible plays in there
7+
- xmpp2/default.yml # just a list of other files

requirements.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: 2025 Friedrich von Never <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
---
6+
collections:
7+
- name: ansible.posix
8+
version: 1.5.4
9+
- name: community.docker
10+
version: 3.7.0
11+
- name: community.general
12+
version: 8.3.0

xmpp2/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-FileCopyrightText: 2025 Friedrich von Never <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
hosts.ini
6+
7+
vars/secrets.yml
8+
vars/vars.yml

xmpp2/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 Friedrich von Never <[email protected]>
3+
4+
SPDX-License-Identifier: MIT
5+
-->
6+
7+
xmpp2 host
8+
==========
9+
- **Provider:** Digital Ocean
10+
- **OS**: Ubuntu 24.04
11+
12+
How to Deploy
13+
-------------
14+
1. Copy `hosts.example.ini` to `hosts.ini`, fix the host connection details if needed.
15+
2. Copy `vars/vars.example.yml` to `vars/vars.yml` and adjust it accordingly.
16+
3. Copy `vars/secrets.example.yml` to `vars/secrets.yml` and adjust it accordingly.
17+
4. `ansible-vault encrypt vars/secrets.yml`
18+
5. To **check the results** without applying, run `ansible-playbook --ask-vault-pass --ask-become-pass --check --diff default.yml`.
19+
20+
To **deploy**, run `ansible-playbook --ask-vault-pass --ask-become-pass default.yml`.
21+
22+
If on Windows, feel free to use scripts `ansible-vault.ps1`, `ansible-playbook.ps1` as a substitute to use Ansible from WSL.
23+
24+
If running deployment for the first time, then run `ansible-playbook --ask-vault-pass auth.yml` to set up the user accounts and access properly.
25+
26+
Standard Operating Procedures
27+
-----------------------------
28+
29+
### Dump Database Backup for LogList
30+
```console
31+
$ docker exec -i loglist.postgresql pg_dump -d loglist -U postgres -F custom --no-acl > loglist.dmp
32+
```
33+
34+
### Restore Database Backup for LogList
35+
```console
36+
$ docker cp loglist.dmp loglist.postgresql:/loglist.dmp
37+
$ docker exec -i loglist.postgresql pg_restore -d loglist -U loglist --clean --no-owner -1 /loglist.dmp
38+
$ docker exec -i loglist.postgresql rm /loglist.dmp
39+
```

xmpp2/ansible-playbook.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: 2025 Friedrich von Never <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
wsl --distribution Ubuntu ansible-playbook --inventory hosts.ini @args -e 'ansible_ssh_pipelining=True'

xmpp2/ansible-vault.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: 2025 Friedrich von Never <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
wsl --distribution Ubuntu ansible-vault @args

0 commit comments

Comments
 (0)