Ansible_workstation/roles/dotfiles/molecule/default/converge.yml

44 lines
1.1 KiB
YAML
Raw Normal View History

2022-01-05 10:25:33 +00:00
---
- name: Converge
hosts: all
vars:
users:
- username: user1
config2stow: ["nvim", "tmux", "zsh"]
password: "$y$j9T$PR8GfM2MjGudOCd7hF9NP1$/qRGtuNuWaRVVGmB1A4rgtaT0MMB9IoB4fnaxW1kvf4" #plop
- username: user2
password: "$y$j9T$PR8GfM2MjGudOCd7hF9NP1$/qRGtuNuWaRVVGmB1A4rgtaT0MMB9IoB4fnaxW1kvf4" #plop
config2stow: ["nvim", "tmux"]
pre_tasks:
- name: update_cache for arch
pacman:
update_cache: yes
become: yes
when: ansible_os_family == "Archlinux"
- name: update_cache for debian
apt:
update_cache: yes
become: yes
when: ansible_os_family == "Debian"
- name: Create user
ansible.builtin.user:
name: "{{ item.username }}"
password: "{{ item.password }}" #plop
state: present
with_items: "{{ users }}"
become: yes
2022-01-05 10:25:33 +00:00
tasks:
- name: "Include dotfiles"
include_role:
name: "dotfiles"
vars:
username: "{{ user.username }}"
config2stow: "{{ user.config2stow }}"
loop: "{{ users }}"
loop_control:
loop_var: user