Compare commits
2 Commits
transcaffe
...
main
Author | SHA1 | Date | |
---|---|---|---|
b14f36c7e8 | |||
762e2ffc27 |
12
galaxy.yml
12
galaxy.yml
@ -1,21 +1,27 @@
|
|||||||
namespace: finallycoffee
|
namespace: finallycoffee
|
||||||
name: base
|
name: base
|
||||||
version: 0.2.1
|
version: 0.3.0
|
||||||
readme: README.md
|
readme: README.md
|
||||||
authors:
|
authors:
|
||||||
- transcaffeine <transcaffeine@finally.coffee>
|
- transcaffeine <transcaffeine@finally.coffee>
|
||||||
description: Roles for base services which are common dependencies other services like databases
|
description: >-2
|
||||||
|
Roles for base services which are core functionality like managing packages
|
||||||
|
and ssh or common dependencies other services like databases
|
||||||
dependencies:
|
dependencies:
|
||||||
"community.docker": "^4.2.0"
|
"community.docker": "^4.2.0"
|
||||||
|
"community.general": "^10.0.0"
|
||||||
license_file: LICENSE.md
|
license_file: LICENSE.md
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- '*.tar.gz'
|
- '*.tar.gz'
|
||||||
repository: https://git.finally.coffee/finallycoffee/base
|
repository: https://git.finally.coffee/finallycoffee/base
|
||||||
issues: https://codeberg.org/finallycoffee/ansible-collection-base/issues
|
issues: https://codeberg.org/finallycoffee/ansible-collection-base/issues
|
||||||
tags:
|
tags:
|
||||||
|
- bootstrap
|
||||||
|
- ssh
|
||||||
|
- mosh
|
||||||
- docker
|
- docker
|
||||||
- lego
|
- lego
|
||||||
- minio
|
- minio
|
||||||
- nginx
|
- nginx
|
||||||
- restic
|
- restic
|
||||||
- docker
|
- user_management
|
||||||
|
6
playbooks/mosh.yml
Normal file
6
playbooks/mosh.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Manage and configure mosh
|
||||||
|
hosts: "{{ mosh_hosts | default('mosh', true) }}"
|
||||||
|
become: "{{ mosh_become | default(true) }}"
|
||||||
|
roles:
|
||||||
|
- role: finallycoffee.base.mosh
|
4
roles/mosh/README.md
Normal file
4
roles/mosh/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# `finallycoffee.base.mosh`
|
||||||
|
|
||||||
|
Installs [`mosh`](https://mosh.org/#), a remote 'mobile shell' which supports
|
||||||
|
roaming and re-uses SSH for the authentication layer.
|
2
roles/mosh/defaults/main/main.yml
Normal file
2
roles/mosh/defaults/main/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
mosh_state: present
|
15
roles/mosh/defaults/main/packages.yml
Normal file
15
roles/mosh/defaults/main/packages.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
mosh_debian_packages:
|
||||||
|
- "mosh"
|
||||||
|
- "openssh-server"
|
||||||
|
mosh_fedora_packages:
|
||||||
|
- "mosh"
|
||||||
|
- "openssh-server"
|
||||||
|
mosh_archlinux_packages:
|
||||||
|
- "mosh"
|
||||||
|
- "openssh"
|
||||||
|
|
||||||
|
mosh_packages:
|
||||||
|
debian: "{{ mosh_debian_packages }}"
|
||||||
|
fedora: "{{ mosh_fedora_packages }}"
|
||||||
|
archlinux: "{{ mosh_archlinux_packages }}"
|
30
roles/mosh/tasks/install.yml
Normal file
30
roles/mosh/tasks/install.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure mosh is {{ mosh_state }} (dnf)
|
||||||
|
ansible.builtin.dnf:
|
||||||
|
name: "{{ mosh_packages[_key] }}"
|
||||||
|
state: "{{ mosh_state }}"
|
||||||
|
when:
|
||||||
|
- ansible_facts['pkg_mgr'] in ['dnf', 'dnf5']
|
||||||
|
- _key in mosh_packages.keys()
|
||||||
|
vars:
|
||||||
|
_key: "{{ ansible_distribution | lower }}"
|
||||||
|
|
||||||
|
- name: Ensure mosh is {{ mosh_state }} (apt)
|
||||||
|
ansible.builtin.apt:
|
||||||
|
package: "{{ mosh_packages[_key] }}"
|
||||||
|
state: "{{ mosh_state }}"
|
||||||
|
when:
|
||||||
|
- ansible_facts['pkg_mgr'] in ['apt']
|
||||||
|
- _key in mosh_packages.keys()
|
||||||
|
vars:
|
||||||
|
_key: "{{ ansible_distribution | lower }}"
|
||||||
|
|
||||||
|
- name: Ensure mosh is {{ mosh_state }} (pacman)
|
||||||
|
community.general.pacman:
|
||||||
|
name: "{{ mosh_packages[_key] }}"
|
||||||
|
state: "{{ mosh_state }}"
|
||||||
|
when:
|
||||||
|
- ansible_facts['pkg_mgr'] in ['pacman']
|
||||||
|
- _key in mosh_packages.keys()
|
||||||
|
vars:
|
||||||
|
_key: "{{ ansible_distribution | lower }}"
|
11
roles/mosh/tasks/main.yml
Normal file
11
roles/mosh/tasks/main.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure 'mosh_state' is valid
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-2
|
||||||
|
Invalid state '{{ mosh_state }}' for 'mosh_state'!
|
||||||
|
Allowed states are {{ mosh_states | join(', ') }}.
|
||||||
|
when: mosh_state not in mosh_states
|
||||||
|
|
||||||
|
- name: Ensure mosh is {{ mosh_state }}
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: "install.yml"
|
4
roles/mosh/vars/main.yml
Normal file
4
roles/mosh/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
mosh_states:
|
||||||
|
- "present"
|
||||||
|
- "absent"
|
Loading…
x
Reference in New Issue
Block a user