user_config/tasks/main.yml
vincent 36a7f7ff39
Some checks failed
continuous-integration/drone/push Build is failing
comment change shell
2022-05-31 14:13:03 +02:00

47 lines
1.7 KiB
YAML

---
# tasks file for user_config
- name: clone user repository
git:
dest: /home/{{user.name}}/conf2 # required. The path of where the repository should be checked out. This parameter is required, unless C(clone) is set to C(no).
repo: "{{ user_config_repo }}" # required. git, SSH, or HTTP(S) protocol address of the git repository.
clone: yes # not required. If C(no), do not clone the repository if it does not exist locally
recursive: yes
force: no
update: yes
accept_hostkey: yes
register: config_download
- debug:
msg: "{{ config_download }}"
#- name: pass user shell to zsh
# user:
# name: "{{user.name}}" # required. Name of the user to create, remove or modify.
# shell: /bin/zsh # not required. Optionally set the user's shell.,On macOS, before version 2.5, the default shell for non-system users was /usr/bin/false. Since 2.5, the default shell for non-system users on macOS is /bin/bash.
# state: present # not required. choices: absent;present. Whether the account should exist or not, taking action if the state is different from what is stated.
# become: yes
- name: test if user bash rc exist
stat:
path: /home/{{user.name}}/.bashrc
register: links
- name: delete bashrc if needed
file:
path: "{{ links.stat.path }}"
state: absent
when: links.stat.islnk is defined and not links.stat.islnk
- name: apply stow config
shell: stow *
args:
chdir: /home/{{user.name}}/conf2
when: config_download.changed == true
- name: apply stow config on root
shell: stow --t /root zsh vim git bat
args:
chdir: /home/{{user.name}}/conf2
when: config_download.changed == true
become: yes