Don't inject facts as vars

This commit is contained in:
2020-06-27 15:56:55 +02:00
parent bce3dc670b
commit 38b3239854
18 changed files with 73 additions and 72 deletions
+13 -13
View File
@@ -1,13 +1,13 @@
---
- name: Set authorized SSH keys
authorized_key:
user: "{{ ansible_user_id }}"
user: "{{ ansible_facts.user_id }}"
state: present
key: "{{ item }}"
with_file: authorized_keys
- name: Get current shell
shell: "getent passwd {{ ansible_user_id }} | cut -d: -f7"
shell: "getent passwd {{ ansible_facts.user_id }} | cut -d: -f7"
register: current_shell
changed_when: no
@@ -18,37 +18,37 @@
- name: Copy dotfiles to home directory
copy:
src: dotfiles/
dest: "{{ ansible_env.HOME }}/"
dest: "{{ ansible_facts.env.HOME }}/"
mode: preserve
- name: Copy Git config to home directory
template:
src: gitconfig.j2
dest: "{{ ansible_env.HOME }}/.config/git/config"
dest: "{{ ansible_facts.env.HOME }}/.config/git/config"
- name: Remove unneeded files
file:
path: "{{ item }}"
state: absent
loop:
- "{{ ansible_env.HOME }}/.bash_history"
- "{{ ansible_env.HOME }}/.bash_logout"
- "{{ ansible_env.HOME }}/.bash_profile"
- "{{ ansible_env.HOME }}/.bashrc"
- "{{ ansible_env.HOME }}/.emacs"
- "{{ ansible_env.HOME }}/.zcompdump"
- "{{ ansible_env.HOME }}/.zshrc"
- "{{ ansible_facts.env.HOME }}/.bash_history"
- "{{ ansible_facts.env.HOME }}/.bash_logout"
- "{{ ansible_facts.env.HOME }}/.bash_profile"
- "{{ ansible_facts.env.HOME }}/.bashrc"
- "{{ ansible_facts.env.HOME }}/.emacs"
- "{{ ansible_facts.env.HOME }}/.zcompdump"
- "{{ ansible_facts.env.HOME }}/.zshrc"
- name: Download and update iTerm2 shell integration
get_url:
url: https://iterm2.com/shell_integration/fish
dest: "{{ ansible_env.HOME }}/.config/fish/conf.d/iterm2_integration.fish"
dest: "{{ ansible_facts.env.HOME }}/.config/fish/conf.d/iterm2_integration.fish"
force: yes
- name: Download and update Oh My Fish! packages
git:
repo: "{{ item.value }}"
dest: "{{ ansible_env.HOME }}/.config/fish/pkgs/{{ item.key }}"
dest: "{{ ansible_facts.env.HOME }}/.config/fish/pkgs/{{ item.key }}"
loop: "{{ omf_pkgs | dict2items }}"
notify: Collect fish functions from packages
+1 -1
View File
@@ -1,6 +1,6 @@
; user settings
[user]
name = kodos-{{ ansible_user_id }}.codesignd.net
name = kodos-{{ ansible_facts.user_id }}.codesignd.net
email = hostmaster@codesignd.net
; core settings