init
This commit is contained in:
commit
55d1e0c105
4
ansible.cfg
Normal file
4
ansible.cfg
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[defaults]
|
||||||
|
interpreter_python = /usr/bin/python3
|
||||||
|
ansible_python_interpreter = /usr/bin/python3
|
||||||
|
roles_path = ./roles/:~/.ansible/roles:/etc/ansible/roles
|
13
create-role.sh
Executable file
13
create-role.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "$0 <role_name>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ROLE="${1}"
|
||||||
|
|
||||||
|
mkdir roles/${ROLE}
|
||||||
|
|
||||||
|
mkdir roles/${ROLE}/{defaults,handlers,tasks,templates,files}
|
||||||
|
|
||||||
|
touch roles/${ROLE}/{defaults,handlers,tasks,templates,files}/main.yml
|
15
inventory.yml
Normal file
15
inventory.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
all:
|
||||||
|
hosts:
|
||||||
|
houdini:
|
||||||
|
ansible_host: houdini.abbiamoundominio.org
|
||||||
|
ranma:
|
||||||
|
ansible_host: 109.123.246.23
|
||||||
|
|
||||||
|
children:
|
||||||
|
dev:
|
||||||
|
hosts:
|
||||||
|
houdini: {}
|
||||||
|
prod:
|
||||||
|
hosts:
|
||||||
|
ranma: {}
|
4
playbooks/base.yml
Normal file
4
playbooks/base.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- base
|
0
roles/base/defaults/main.yml
Normal file
0
roles/base/defaults/main.yml
Normal file
0
roles/base/files/main.yml
Normal file
0
roles/base/files/main.yml
Normal file
0
roles/base/handlers/main.yml
Normal file
0
roles/base/handlers/main.yml
Normal file
30
roles/base/tasks/docker.yml
Normal file
30
roles/base/tasks/docker.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
---
|
||||||
|
- name: Install required packages
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- apt-transport-https
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- gnupg2
|
||||||
|
- software-properties-common
|
||||||
|
|
||||||
|
- name: Add Docker GPG key
|
||||||
|
apt_key:
|
||||||
|
url: https://download.docker.com/linux/debian/gpg
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add Docker repository
|
||||||
|
apt_repository:
|
||||||
|
repo: deb [arch=amd64] https://download.docker.com/linux/debian bookworm stable
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Install Docker Engine
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- containerd.io
|
||||||
|
|
||||||
|
- name: Start Docker service
|
||||||
|
service:
|
||||||
|
name: docker
|
1
roles/base/tasks/main.yml
Normal file
1
roles/base/tasks/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
- include_tasks: docker.yml
|
0
roles/base/templates/main.yml
Normal file
0
roles/base/templates/main.yml
Normal file
Loading…
Reference in New Issue
Block a user