push
This commit is contained in:
commit
2cd6e7d0f9
10
README.md
Normal file
10
README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Debian 13 Ansible workstation installation
|
||||
|
||||
## Configuration
|
||||
|
||||
## Utilisation
|
||||
|
||||
## To do
|
||||
|
||||
- [ ] test
|
||||
|
||||
5
ansible.cfg
Normal file
5
ansible.cfg
Normal file
@ -0,0 +1,5 @@
|
||||
[defaults]
|
||||
inventory = inventory.ini
|
||||
roles_path = roles
|
||||
host_key_checking = False
|
||||
retry_files_enabled = False
|
||||
3
group_vars/all.yml
Normal file
3
group_vars/all.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
timezone: Europe/Paris
|
||||
ansible_user: "{{ lookup('env', 'USER') }}"
|
||||
2
inventory.ini
Normal file
2
inventory.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[debian]
|
||||
localhost ansible_connection=local
|
||||
14
playbooks/install.yml
Normal file
14
playbooks/install.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Installation Debian 13 complète
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
roles:
|
||||
- common
|
||||
- docker
|
||||
- podman
|
||||
- go
|
||||
- devtools
|
||||
- libvirt
|
||||
- opentofu
|
||||
- element
|
||||
20
roles/common/tasks/main.yml
Normal file
20
roles/common/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Mise à jour APT
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Paquets de base
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- ca-certificates
|
||||
- curl
|
||||
- wget
|
||||
- gnupg
|
||||
- git
|
||||
- vim
|
||||
- htop
|
||||
- btop
|
||||
- wireguard
|
||||
- python3-venv
|
||||
state: present
|
||||
86
roles/devtools/tasks/main.yml
Normal file
86
roles/devtools/tasks/main.yml
Normal file
@ -0,0 +1,86 @@
|
||||
---
|
||||
- name: Installer outils développeur
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- build-essential
|
||||
- python3
|
||||
- python3-pip
|
||||
- python3-venv
|
||||
- linuxlogo
|
||||
- lolcat
|
||||
- vagrant
|
||||
- links2
|
||||
- kew
|
||||
state: present
|
||||
|
||||
# VScodium
|
||||
- name: Ajouter la clé GPG VSCodium
|
||||
ansible.builtin.get_url:
|
||||
url: https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg
|
||||
dest: /usr/share/keyrings/vscodium.gpg
|
||||
mode: '0644'
|
||||
|
||||
- name: Ajouter le dépôt VSCodium
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb [signed-by=/usr/share/keyrings/vscodium.gpg] https://download.vscodium.com/debs vscodium main"
|
||||
filename: vscodium
|
||||
state: present
|
||||
|
||||
- name: Installer VSCodium
|
||||
ansible.builtin.apt:
|
||||
name: codium
|
||||
update_cache: true
|
||||
state: present
|
||||
tags: vscodium
|
||||
|
||||
# Tabby.sh
|
||||
- name: Télécharger Tabby
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ tabby_deb_url }}"
|
||||
dest: /tmp/tabby.deb
|
||||
mode: '0644'
|
||||
tags: tabby
|
||||
|
||||
- name: Installer Tabby
|
||||
ansible.builtin.apt:
|
||||
deb: /tmp/tabby.deb
|
||||
state: present
|
||||
tags: tabby
|
||||
|
||||
- name: Vérifier si Go est déjà installé
|
||||
ansible.builtin.stat:
|
||||
path: "{{ go_install_dir }}/go/bin/go"
|
||||
register: go_installed
|
||||
tags: go
|
||||
|
||||
# Go
|
||||
- name: Télécharger Go {{ go_version }}
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ go_url }}"
|
||||
dest: "/tmp/{{ go_tarball }}"
|
||||
mode: '0644'
|
||||
when: not go_installed.stat.exists
|
||||
tags: go
|
||||
|
||||
- name: Supprimer ancienne installation Go
|
||||
ansible.builtin.file:
|
||||
path: "{{ go_install_dir }}/go"
|
||||
state: absent
|
||||
when: not go_installed.stat.exists
|
||||
tags: go
|
||||
|
||||
- name: Installer Go {{ go_version }}
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/{{ go_tarball }}"
|
||||
dest: "{{ go_install_dir }}"
|
||||
remote_src: true
|
||||
when: not go_installed.stat.exists
|
||||
tags: go
|
||||
|
||||
- name: Ajouter Go au PATH global
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/profile.d/go.sh
|
||||
mode: '0755'
|
||||
content: |
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
tags: go
|
||||
9
roles/devtools/vars/main.yml
Normal file
9
roles/devtools/vars/main.yml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
tabby_version: "1.0.215"
|
||||
tabby_deb_url: "https://github.com/Eugeny/tabby/releases/download/v{{ tabby_version }}/tabby-{{ tabby_version }}-linux-x64.deb"
|
||||
|
||||
go_version: "1.22.1"
|
||||
go_arch: "amd64"
|
||||
go_tarball: "go{{ go_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
go_url: "https://go.dev/dl/{{ go_tarball }}"
|
||||
go_install_dir: /usr/local
|
||||
19
roles/docker/tasks/main.yml
Normal file
19
roles/docker/tasks/main.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
- name: Installer Docker
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- docker.io
|
||||
- docker-compose
|
||||
state: present
|
||||
|
||||
- name: Activer Docker
|
||||
ansible.builtin.service:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Ajouter l'utilisateur au groupe docker
|
||||
ansible.builtin.user:
|
||||
name: "{{ ansible_user }}"
|
||||
groups: docker
|
||||
append: true
|
||||
13
roles/element/tasks/main.yml
Normal file
13
roles/element/tasks/main.yml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Télécharger Element Desktop
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ element_deb_url }}"
|
||||
dest: /tmp/element-desktop.deb
|
||||
mode: '0644'
|
||||
tags: element
|
||||
|
||||
- name: Installer Element Desktop
|
||||
ansible.builtin.apt:
|
||||
deb: /tmp/element-desktop.deb
|
||||
state: present
|
||||
tags: element
|
||||
3
roles/element/vars/main.yml
Normal file
3
roles/element/vars/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
element_version: "1.11.73"
|
||||
element_deb_url: "https://packages.element.io/debian/pool/main/e/element-desktop/element-desktop_{{ element_version }}_amd64.deb"
|
||||
22
roles/libvirt/tasks/main.yml
Normal file
22
roles/libvirt/tasks/main.yml
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Installer libvirt/KVM
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- qemu-kvm
|
||||
- libvirt-daemon-system
|
||||
- libvirt-clients
|
||||
- virtinst
|
||||
- virt-manager
|
||||
state: present
|
||||
|
||||
- name: Activer libvirtd
|
||||
ansible.builtin.service:
|
||||
name: libvirtd
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Ajouter l'utilisateur aux groupes libvirt et kvm
|
||||
ansible.builtin.user:
|
||||
name: "{{ ansible_user }}"
|
||||
groups: [libvirt, kvm]
|
||||
append: true
|
||||
17
roles/opentofu/tasks/main.yml
Normal file
17
roles/opentofu/tasks/main.yml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Ajouter clé GPG OpenTofu
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ opentofu_key_url }}"
|
||||
dest: /usr/share/keyrings/opentofu.gpg
|
||||
mode: '0644'
|
||||
|
||||
- name: Ajouter dépôt OpenTofu
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb [signed-by=/usr/share/keyrings/opentofu.gpg] {{ opentofu_repo }} stable main"
|
||||
filename: opentofu
|
||||
|
||||
- name: Installer OpenTofu
|
||||
ansible.builtin.apt:
|
||||
name: tofu
|
||||
update_cache: true
|
||||
state: present
|
||||
3
roles/opentofu/vars/main.yml
Normal file
3
roles/opentofu/vars/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
opentofu_repo: https://packages.opentofu.org/opentofu/tofu/any/ any main
|
||||
opentofu_key_url: https://packages.opentofu.org/opentofu/tofu/gpgkey
|
||||
7
roles/podman/defaults/main.yml
Normal file
7
roles/podman/defaults/main.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
podman_packages:
|
||||
- podman
|
||||
- podman-compose
|
||||
- buildah
|
||||
- skopeo
|
||||
- uidmap
|
||||
32
roles/podman/tasks/main.yml
Normal file
32
roles/podman/tasks/main.yml
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Installer Podman et outils associés
|
||||
ansible.builtin.apt:
|
||||
name: "{{ podman_packages }}"
|
||||
state: present
|
||||
tags: podman
|
||||
|
||||
- name: Activer linger pour l'utilisateur (rootless)
|
||||
ansible.builtin.command:
|
||||
cmd: "loginctl enable-linger {{ ansible_user }}"
|
||||
args:
|
||||
creates: "/var/lib/systemd/linger/{{ ansible_user }}"
|
||||
tags: podman
|
||||
|
||||
- name: Créer le répertoire containers utilisateur
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ ansible_user }}/.config/containers"
|
||||
state: directory
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
mode: '0755'
|
||||
tags: podman
|
||||
|
||||
- name: Configurer registries par défaut
|
||||
ansible.builtin.copy:
|
||||
dest: "/home/{{ ansible_user }}/.config/containers/registries.conf"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
mode: '0644'
|
||||
content: |
|
||||
unqualified-search-registries = ["docker.io", "quay.io"]
|
||||
tags: podman
|
||||
Loading…
x
Reference in New Issue
Block a user