
@sylvain_metayer
Goal | State |
Manage configuration files | ? |
Manage installed software | ? |
Version Control | ? |
Maintainability | ? |
Manage personal and pro workstation | ? |
Can handle secrets | ? |
#!/usr/bin/env bash
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket
# ...Others : 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.
Goal | State |
Manage configuration files | β |
Manage installed software | β |
Version Control | β |
Maintainability | β |
Manage personal and pro workstation | π |
Can handle secrets | β |
Bash, PHP… The choice is yours, let’s code!

Goal | State |
Manage configuration files | β |
Manage installed software | β |
Version Control | β |
Maintainability | π |
Manage personal and pro workstation | β |
Can handle secrets | β |
βββ playbooks
β βββ personal
β βββ work
β βββ βββ main.yaml
βββ roles
β βββ jetbrains_toolbox
β β βββ defaults
β β βββ tasks
β βββ git_config
β β βββ tasks
β βββ [...]- hosts: localhost
tasks:
- name: "Simple task"
debug:
msg: |-
Hello DevoxxUK ! :)
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==7.0.0
$ cat requirements.yml
roles:
- src: geerlingguy.docker
version: 6.1.0$ ansible-playbook playbooks/personal/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
62653039646462626165653337346538626534306332323566353963656633333066383732306637
3930366539386637616137336166636233303231666537650a666539623066303731376631616532
38613836653466323132316331646137323665383939376362656535633130646265356434346563
3066363264313834320a333432613265393630313235303161363731356266663733343362356462
37396131643235313936653139353036306363646234366532386138393165383962ansible-vault create secret_data.txt
$ ansible-vault view secret_data.txt
Vault password:
Hello DevoxxUK ! :)
$ ansible-playbook playbooks/work/main.yaml --ask-vault-passβββ personal
β βββ main.yaml
βββ work
βββ main.yamlGoal | State |
Manage configuration files | β |
Manage installed software | β |
Version Control | β |
Maintainability | β |
Manage personal and pro workstation | β |
Can handle secrets | β |