update urubamba role (basic packages)
This commit is contained in:
parent
8d8f209d2f
commit
39c2b425bd
@ -2,3 +2,8 @@
|
|||||||
hosts: all
|
hosts: all
|
||||||
roles:
|
roles:
|
||||||
- users
|
- users
|
||||||
|
- python3
|
||||||
|
- docker
|
||||||
|
- htop
|
||||||
|
- tmux
|
||||||
|
- fail2ban
|
||||||
|
|||||||
30
urubamba/roles/docker/tasks/main.yml
Normal file
30
urubamba/roles/docker/tasks/main.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: "Install dependencies"
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- gnupg
|
||||||
|
state: present
|
||||||
|
- name: "Add Docker GPG key"
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: "https://download.docker.com/{{ ansible_system | lower }}/{{ ansible_distribution | lower }}/gpg"
|
||||||
|
dest: /etc/apt/trusted.gpg.d/docker.asc
|
||||||
|
mode: "0644"
|
||||||
|
force: true
|
||||||
|
- name: "Set up apt repository for Docker"
|
||||||
|
ansible.builtin.apt_repository:
|
||||||
|
repo: >
|
||||||
|
deb [arch={{ architecture[ansible_architecture] }}]
|
||||||
|
https://download.docker.com/{{ ansible_system | lower }}/{{ ansible_distribution | lower }}
|
||||||
|
{{ ansible_distribution_release }} stable
|
||||||
|
update_cache: true
|
||||||
|
- name: "Install docker"
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- containerd.io
|
||||||
|
- docker-buildx-plugin
|
||||||
|
- docker-compose-plugin
|
||||||
|
state: present
|
||||||
5
urubamba/roles/docker/vars/main.yml
Normal file
5
urubamba/roles/docker/vars/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
architecture: {
|
||||||
|
"aarch64": "arm64",
|
||||||
|
"x86_64": "amd64"
|
||||||
|
}
|
||||||
9
urubamba/roles/fail2ban/tasks/main.yml
Normal file
9
urubamba/roles/fail2ban/tasks/main.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Install fail2ban
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: fail2ban
|
||||||
|
state: present
|
||||||
|
- name: Run fail2ban service
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: fail2ban
|
||||||
|
state: reloaded
|
||||||
5
urubamba/roles/htop/tasks/main.yml
Normal file
5
urubamba/roles/htop/tasks/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: Install htop
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: htop
|
||||||
|
state: present
|
||||||
9
urubamba/roles/python3/tasks/main.yml
Normal file
9
urubamba/roles/python3/tasks/main.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Install python3
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: python3
|
||||||
|
state: present
|
||||||
|
- name: Install python3-systemd
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: python3-systemd
|
||||||
|
state: present
|
||||||
13
urubamba/roles/tmux/tasks/main.yml
Normal file
13
urubamba/roles/tmux/tasks/main.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- name: Install tmux
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: tmux
|
||||||
|
state: present
|
||||||
|
- name: Start tmux in .bashrc
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ lookup('env', 'HOME') }}/.bashrc"
|
||||||
|
marker: "# {mark} ANSIBLE MANAGED SECTION (tmux)"
|
||||||
|
block: |
|
||||||
|
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
||||||
|
tmux attach-session -t uruba || tmux new-session -s uruba
|
||||||
|
fi
|
||||||
@ -3,6 +3,7 @@
|
|||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ item.username }}"
|
name: "{{ item.username }}"
|
||||||
password: "{{ item.password | password_hash('sha512') }}"
|
password: "{{ item.password | password_hash('sha512') }}"
|
||||||
|
update_password: on_create
|
||||||
shell: /bin/bash
|
shell: /bin/bash
|
||||||
with_items: "{{ admin_users }}"
|
with_items: "{{ admin_users }}"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user