
@sylvain_metayer
Objectif | État |
Gérer mes fichiers de configuration | ? |
Gérer les logiciels installés | ? |
Versionnable | ? |
Facilement maintenable | ? |
Gérer mon poste de travail pro et perso | ? |
Gestion de secrets | ? |
#!/usr/bin/env bash
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket
# ...Et d’autres : vimrc, gitconfig, …
GNU Stow is a symlink farm manager which takes distinct sets of software and/or data located in separate directories on the filesystem, and makes them all appear to be installed in a single directory tree.
Objectif | État |
Gérer mes fichiers de configuration | ✅ |
Gérer les logiciels installés | ❌ |
Versionnable | ✅ |
Facilement maintenable | ✅ |
Gérer mon poste de travail pro et perso | 😐 |
Gestion de secrets | ❌ |
Du shell, du python, du C, du PHP… Venez comme vous êtes, on va coder !
Objectif | État |
Gérer mes fichiers de configuration | ✅ |
Gérer les logiciels installés | ✅ |
Versionnable | ✅ |
Facilement maintenable | 😐 |
Gérer mon poste de travail pro et perso | ✅ |
Gestion de secrets | ✅ |
├── playbooks
│ ├── perso
│ ├── pro
│ ├── ├── main.yaml
├── roles
│ ├── jetbrains_toolbox
│ │ ├── defaults
│ │ ├── tasks
│ │── git_config
│ │ ├── tasks
│ └── [...]---
- hosts: localhost
tasks:
- name: "Simple task"
debug:
msg: |-
Hello TNT#25 ! :)
roles:
- role: geerlingguy.docker
become: true
- role: git_config$ cat scripts/setup.sh
python3 -m pip install --user -r "requirements.txt"
ansible-galaxy role install -r "requirements.yml"
$ cat requirements.txt
ansible==11.2.0
$ cat requirements.yml
roles:
- src: geerlingguy.docker
version: 7.4.4$ ansible-playbook playbooks/perso/main.yaml -K
BECOME password:PLAY [localhost] ************************************
TASK [git_config : Ensure Git config file exists] ************************************
ok: [localhost]
TASK [git_config : Render Git config Template] ************************************
changed: [localhost]
PLAY RECAP ************************************
localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Playbook run took 0 days, 0 hours, 0 minutes, 1 secondspackages_to_install:
- vim
- firefox
- code- name: Install packages
become: true
ansible.builtin.package:
name: "{{ packages_to_install }}"
state: present- hosts: localhost
roles:
- role: commons
vars:
packages_to_install: [vim, firefox]roles/symlink
├── files
│ ├── .config
│ │ ├── htop
│ │ │ └── htoprc
│ └── .vimrc---
# item = .vimrc
# [...] Create folders
# [...] Ensure file does not exists
- name: "{{ item }} : Update dotfile symlink"
file:
src: "{{ role_path }}/files/{{ item }}"
dest: ~/{{ item }}
state: link- name: Template gitconfig
ansible.builtin.template:
src: templates/gitconfig.j2
dest: "~/.gitconfig"[user]
{% if git_config_user is defined %}
name = {{ git_config_user }}
{% endif %}
{% if git_config_email is defined %}
email = {{ git_config_email }}
{% endif %}- name: "Copy secret file"
copy:
src: "secret_data.txt"
dest: ~/secret_data.txt
mode: "0600"$ANSIBLE_VAULT;1.1;AES256
61613732623662623936633538623331663661303939636439316236633333356561646562356335
3936383330653736393132313565643539326666666366360a323539623938626232663965336264
32616364633761616231336464303732323936393131346536646465313162623537303363366265
6334613463623635620a663765366238353435373336373832396536386164346266626433303165
66336136313064323461613461303461643864316361653838333565396633616564$ ansible-vault create secret_data.txt
$ ansible-vault view secret_data.txt
Vault password:
Hello TNT#25 ! :)
$ ansible-playbook playbooks/work/main.yaml --ask-vault-pass
- name: Display battery percentage
dconf:
key: "/org/gnome/desktop/interface/show-battery-percentage"
value: "true"
state: present
Windows (regedit) : win_regedit_module
Objectif | État |
Gérer mes fichiers de configuration | ✅ |
Gérer les logiciels installés | ✅ |
Versionnable | ✅ |
Facilement maintenable | ✅ |
Gérer mon poste de travail pro et perso | ✅ |
Gestion de secrets | ✅ |