Skip to content

Commit

Permalink
Removed unused base_path facts or swap to playbook_dir builtin var.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackson15j committed Jan 19, 2019
1 parent 99a4c11 commit 4c0887b
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 145 deletions.
14 changes: 5 additions & 9 deletions bash/bash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@
- name: Running the Bash ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/bash/'

- name: Set global git user name
command: git config --global user.name "Craig Astill"

- name: Set global git user email
command: git config --global user.email "[email protected]"

- name: Set global git user name
command: git config --global github.user "jackson15j"

- name: Symlink config files to user home directory
file:
src: '{{base_path}}{{item}}'
src: '{{playbook_dir}}/{{item}}'
dest: '~/{{item}}'
state: link
force: yes
Expand Down Expand Up @@ -109,7 +105,7 @@
become: true
become_method: sudo
copy:
src: '{{base_path}}smb.conf'
src: '{{playbook_dir}}/smb.conf'
dest: /etc/samba/
owner: 'root'
group: 'root'
Expand Down
7 changes: 0 additions & 7 deletions bash/gnome/gnome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
- name: Running the gnome window manager ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/bash/'

- name: Apply Gnome touchpad settings
# Gnome (Wayland) stamps over my xorg touch pad settings, so lets fix
# them up.
Expand Down
9 changes: 1 addition & 8 deletions bash/spectrwm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
- name: Running the Spectrwm ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/bash/'

- name: Symlink Spectrwm (tiled window manager) config to user home directory
file:
src: '{{base_path}}.spectrwm.conf'
src: '{{playbook_dir}}/.spectrwm.conf'
dest: ~/.spectrwm.conf
state: link
force: yes
Expand Down
20 changes: 6 additions & 14 deletions bash/tmux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
- name: Running the Tmux ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/bash/'

- name: add the user 'tmux' as a guest account.
become: true
become_method: sudo
Expand All @@ -23,15 +16,15 @@
become: true
become_method: sudo
copy:
src: '{{base_path}}.bashrc_tmux'
src: '{{playbook_dir}}/.bashrc_tmux'
dest: '/home/tmux/.bashrc'
owner: tmux
group: tmux
force: yes

- name: Symlink tmux config files to tmux user home directory
file:
src: '{{base_path}}{{item}}'
src: '{{playbook_dir}}/{{item}}'
dest: '~/{{item}}'
state: link
force: yes
Expand All @@ -42,7 +35,7 @@
become: true
become_method: sudo
copy:
src: '{{base_path}}tmux_share'
src: '{{playbook_dir}}/tmux_share'
dest: /usr/local/bin/
owner: '{{ansible_user_id}}'
group: '{{ansible_user_gid}}'
Expand All @@ -52,7 +45,6 @@
become: true
become_method: sudo
pacman:
name: "{{ item }}"
name:
- tmux
state: latest
with_items:
- tmux
11 changes: 2 additions & 9 deletions bash/xfce4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
- name: Running the xfce4 window manager ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/bash/'

- name: Symlink xfce4 config directories to ~/.config/
file:
src: '{{base_path}}{{item}}'
src: '{{playbook_dir}}/{{item}}'
dest: '~/.config/{{item}}'
state: link
force: yes
Expand Down Expand Up @@ -53,7 +46,7 @@
# to quickly generate the xrandr line to fix this up with a script.
# TODO: display detection to get our scripts called on hotplug.
file:
src: '{{base_path}}.screenlayout'
src: '{{playbook_dir}}/.screenlayout'
dest: ~/.screenlayout
state: link
force: yes
15 changes: 4 additions & 11 deletions dell/dell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
- name: Running the Dell XPS 13 ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/dell/'

- name: Install Dell packages
become: true
become_method: sudo
Expand Down Expand Up @@ -44,7 +37,7 @@
become: true
become_method: sudo
copy:
src: '{{base_path}}{{item}}'
src: '{{playbook_dir}}/{{item}}'
dest: /etc/systemd/
owner: 'root'
group: 'root'
Expand All @@ -66,7 +59,7 @@
become: true
become_method: sudo
copy:
src: '{{base_path}}30-touchpad.conf'
src: '{{playbook_dir}}/30-touchpad.conf'
dest: /etc/X11/xorg.conf.d/
owner: 'root'
group: 'root'
Expand All @@ -78,7 +71,7 @@
become: true
become_method: sudo
copy:
src: '{{base_path}}blacklist.conf'
src: '{{playbook_dir}}/blacklist.conf'
dest: /etc/modprobe.d/
owner: 'root'
group: 'root'
Expand All @@ -89,7 +82,7 @@
become: true
become_method: sudo
copy:
src: '{{base_path}}90-override.conf'
src: '{{playbook_dir}}/90-override.conf'
dest: /etc/sysctl.d/
owner: 'root'
group: 'root'
Expand Down
7 changes: 0 additions & 7 deletions dev_env/c_sharp.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
- name: Running the C# Dev Environment ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/'

- name: Install C# packages
become: true
become_method: sudo
Expand Down
7 changes: 0 additions & 7 deletions dev_env/cpp.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
- name: Running the C++ Dev Environment ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/'

- name: Install C++ packages
become: true
become_method: sudo
Expand Down
7 changes: 0 additions & 7 deletions dev_env/dev_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
- name: Running the Dev Environment ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/'

- name: Install remote working packages
become: true
become_method: sudo
Expand Down
7 changes: 0 additions & 7 deletions dev_env/java.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
- name: Running the Java Dev Environment ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/'

- name: Install Java packages.
become: true
become_method: sudo
Expand Down
7 changes: 0 additions & 7 deletions dev_env/productivity.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
- name: Running the Productivity Dev Environment ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/'

- name: Install general productivity packages
become: true
become_method: sudo
Expand Down
7 changes: 0 additions & 7 deletions dev_env/python.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
- name: Running the Python Dev Environment ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/'

- name: Install system-wide python packages
become: true
become_method: sudo
Expand Down
7 changes: 0 additions & 7 deletions dev_env/random.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
- name: Running the Random Dev Environment ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/'

- name: Install random stuff I am toying with, but are not core packages
become: true
become_method: sudo
Expand Down
15 changes: 2 additions & 13 deletions music/music.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,10 @@
- name: Running the Music ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path
tags:
- music

- set_fact:
base_path: '{{repo_base_path.stdout}}/music/'
tags:
- music

# Tasks to install Music packages for the configs like mpd/abcde.
- name: Symlink music configs to user home directory
file:
src: '{{base_path}}{{ item }}'
src: '{{playbook_dir}}/{{ item }}'
dest: '~/{{ item }}'
state: link
force: yes # See: https://github.com/ansible/ansible/issues/7627
Expand All @@ -37,7 +26,7 @@

- name: Symlink .mpd directory to ~/Music/.mpd/
file:
src: '{{base_path}}.mpd'
src: '{{playbook_dir}}/.mpd'
dest: ~/Music/.mpd
state: link
force: yes
Expand Down
7 changes: 0 additions & 7 deletions photos/photos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
- name: Running the Photo ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/photos/'

- name: Install photo packages
become: true
become_method: sudo
Expand Down
11 changes: 0 additions & 11 deletions video/video.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@
- name: Running the Video ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path
tags:
- video

- set_fact:
base_path: '{{repo_base_path.stdout}}/video/'
tags:
- video

- name: Install Video packages
become: true
become_method: sudo
Expand Down
7 changes: 0 additions & 7 deletions web/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
- name: Running the Web ansible playbook...
hosts: localhost
tasks:
- name: Get repo base path
command: git rev-parse --show-toplevel
register: repo_base_path

- set_fact:
base_path: '{{repo_base_path.stdout}}/web/'

# - name: Get PGP key for discord's libc dependency
# # https://aur.archlinux.org/packages/libc%2B%2B/
# command: gpg --recv-keys 0FC3042E345AD05D
Expand Down

0 comments on commit 4c0887b

Please sign in to comment.