Replace user and home with variables

This commit is contained in:
Jake Howard 2018-09-17 17:22:15 +01:00
parent 7402035714
commit 56e9df3c0c
Signed by: jake
GPG key ID: 57AFB45680EDD477
12 changed files with 67 additions and 65 deletions

View file

@ -1,8 +1,8 @@
- file:
src: "/etc/xdg/autostart/{{ item }}.desktop"
dest: "/home/jake/.config/autostart/{{ item }}.desktop"
dest: "{{ home }}/.config/autostart/{{ item }}.desktop"
mode: 0644
owner: jake
owner: "{{ user }}"
state: link
force: true
with_items:

View file

@ -1,6 +1,6 @@
- user:
name: jake
home: '/home/jake'
name: "{{ user }}"
home: "{{ home }}"
comment: Jake Howard
shell: '/usr/bin/zsh'
uid: 1000
@ -12,10 +12,10 @@
- wheel
- file:
state: directory
path: '/home/jake/Projects'
owner: jake
path: '{{ home }}/Projects'
owner: "{{ user }}"
- file:
state: directory
path: '/opt/pyenv'
owner: jake
owner: "{{ user }}"
group: users

View file

@ -2,62 +2,62 @@
src: ./files/libinput-gestures.conf
dest: /etc/libinput-gestures.conf
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/terminator.conf
dest: /home/jake/.config/terminator/config
dest: "{{ home }}/.config/terminator/config"
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/uniemoji.json
dest: /home/jake/.config/uniemoji/custom.json
dest: "{{ home }}/.config/uniemoji/custom.json"
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/assh.yml
dest: /home/jake/.ssh/assh.yml
dest: "{{ home}}/.ssh/assh.yml"
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/gitignore_global
dest: /home/jake/.config/.gitignore
dest: "{{ home }}/.config/.gitignore"
mode: 0644
owner: jake
owner: "{{ user }}"
- template:
src: ./files/gitconfig.conf
dest: /home/jake/.gitconfig
dest: "{{ home }}/.gitconfig"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users
- copy:
src: ./files/rofi.conf
dest: /home/jake/.config/rofi/config
dest: "{{ home }}/.config/rofi/config"
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/touchpad.conf
dest: /usr/share/X11/xorg.conf.d/30-touchpad.conf
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/caret-preferences.md
dest: /home/jake/.config/Caret/Preferences.md
dest: "{{ home }}/.config/Caret/Preferences.md"
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/alacritty.yml
dest: /home/jake/.config/alacritty/alacritty.yml
dest: "{{ home }}/.config/alacritty/alacritty.yml"
mode: 0644
owner: jake
owner: "{{ user }}"
# - name: Tilix config
# shell: "dconf load /etc/gexperts/Tilix/"

View file

@ -1,15 +1,15 @@
- name: "DabApps Dotfiles"
git:
repo: git@github.com:dabapps/dotfiles
dest: /home/jake/Projects/dotfiles
dest: "{{ home }}/Projects/dotfiles"
force: true
become: true
become_user: jake
become_user: "{{ user }}"
- file:
src: /home/jake/Projects/dotfiles/.editorconfig
dest: /home/jake/Projects/.editorconfig
src: "{{ home }}/Projects/dotfiles/.editorconfig"
dest: "[{ home }}/Projects/.editorconfig"
mode: 0644
owner: jake
owner: "{{ user }}"
state: link
force: true

View file

@ -1,7 +1,7 @@
- copy:
src: ./files/Templates
dest: /home/jake/Templates
dest: "{{ home }}/Templates"
mode: 0755
owner: jake
owner: "{{ user }}"
group: users
directory_mode: true

View file

@ -1,34 +1,34 @@
- copy:
src: ./files/i3.conf
dest: /home/jake/.config/i3/config
dest: "{{ home }}/.config/i3/config"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users
- copy:
src: ./files/i3status.conf
dest: /home/jake/.config/i3status/config
dest: "{{ home }}/.config/i3status/config"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users
- copy:
src: ./files/compton.conf
dest: /home/jake/.config/compton.conf
dest: "{{ home }}/.config/compton.conf"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users
- copy:
src: ./files/dunst.conf
dest: /home/jake/.config/dunst/dunstrc
dest: "{{ home }}/.config/dunst/dunstrc"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users
- template:
src: ./files/i3status-rust.toml
dest: /home/jake/.config/i3/status.toml
dest: "{{ home }}/.config/i3/status.toml"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users

View file

@ -1,13 +1,13 @@
- file:
state: directory
path: /home/jake/.dotfiles
owner: jake
path: "{{ home }}/.dotfiles"
owner: "{{ user }}"
group: users
- file:
state: link
src: /home/jake/.dotfiles/.upload
dest: /home/jake/.upload
src: "{{ home }}/.dotfiles/.upload"
dest: "{{ home }}/.upload"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users

View file

@ -1,22 +1,22 @@
- template:
src: ./files/zshrc/.zshrc
dest: /home/jake/.zshrc
dest: "{{ home }}/.zshrc"
mode: 0644
owner: jake
owner: "{{ user }}"
validate: "zsh -n %s"
- copy:
src: /usr/share/nvm/init-nvm.sh
dest: /home/jake/.nvm/nvm.sh
dest: "{{ home }}/.nvm/nvm.sh"
mode: 0755
owner: jake
owner: "{{ user }}"
group: users
- copy:
src: ./files/bin
dest: /home/jake/.bin
dest: "{{ home }}/.bin"
mode: 0755
owner: jake
owner: "{{ user }}"
group: users
directory_mode: true
@ -29,7 +29,7 @@
- copy:
src: ./files/tmux.conf
dest: /home/jake/.tmux.conf
dest: "{{ home }}/.tmux.conf"
mode: 0755
owner: jake
owner: "{{ user }}"
group: users

View file

@ -1,8 +1,8 @@
- copy:
src: ./files/vimrc
dest: /home/jake/.vimrc
dest: "{{ home }}/.vimrc"
mode: 0644
owner: jake
owner: "{{ user }}"
group: users
- copy:

View file

@ -1,25 +1,25 @@
- copy:
src: ./files/vscode-settings.json
dest: /home/jake/.config/Code/User/settings.json
dest: "{{ home }}/.config/Code/User/settings.json"
mode: 0644
owner: jake
owner: "{{ user }}"
- copy:
src: ./files/vscode-keybindings.json
dest: /home/jake/.config/Code/User/keybindings.json
dest: "{{ home }}/.config/Code/User/keybindings.json"
mode: 0644
owner: jake
owner: "{{ user }}"
- name: "Get VSCode extensions"
shell: "code --list-extensions"
become: true
become_user: jake
become_user: "{{ user }}"
register: vscode_extensions
- name: "Install VSCode extensions"
shell: "code --install-extension {{ item }}"
become: true
become_user: jake
become_user: "{{ user }}"
when: "item not in vscode_extensions.stdout_lines"
with_items:
- 'PKief.material-icon-theme'

View file

@ -5,7 +5,7 @@
- copy:
src: ./files/.yaourtrc
dest: /home/jake/.yaourtrc
dest: "{{ home }}/.yaourtrc"
mode: 0644
- set_fact:
@ -18,7 +18,7 @@
- name: "Add keys"
shell: "gpg --recv-keys {{ item }}"
with_items: "{{ keys }}"
become: jake
become: "{{ user }}"
- name: "Add keys to pacman"
shell: "pacman-key -r {{ item }}"

View file

@ -0,0 +1,2 @@
user: jake
home: "/home/{{ user }}"