Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions roles/apt-sources-ubc/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
- name: Ensure ubuntu-keyring is installed
ansible.builtin.apt:
name: ubuntu-keyring
state: present
update_cache: yes
- block:
- name: Ensure ubuntu-keyring is installed
ansible.builtin.apt:
name: ubuntu-keyring
state: present
update_cache: yes

- name: Ensure codename aware and dual-source ubuntu.sources is in place
ansible.builtin.template:
src: ubuntu.sources.j2
dest: /etc/apt/sources.list.d/ubuntu.sources
owner: root
group: root
mode: '0644'
backup: yes
- name: Ensure codename aware and dual-source ubuntu.sources is in place
ansible.builtin.template:
src: ubuntu.sources.j2
dest: /etc/apt/sources.list.d/ubuntu.sources
owner: root
group: root
mode: '0644'
backup: yes

- name: Update apt cache
ansible.builtin.apt:
update_cache: yes
- name: Update apt cache
ansible.builtin.apt:
update_cache: yes
tags: ['apt-sources-ubc']
30 changes: 16 additions & 14 deletions roles/base/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
---
- name: apt packages tasks
import_tasks: apt-packages.yml
- block:
- name: apt packages tasks
import_tasks: apt-packages.yml

# - name: development tools and libraries tasks
# import_tasks: dev-packages.yml
# - name: development tools and libraries tasks
# import_tasks: dev-packages.yml

- name: ssh tasks
import_tasks: ssh.yml
- name: ssh tasks
import_tasks: ssh.yml

- name: security tasks
import_tasks: security.yml
- name: security tasks
import_tasks: security.yml

- name: optimize tasks
import_tasks: optimize.yml
- name: optimize tasks
import_tasks: optimize.yml

- name: powersave tasks
import_tasks: powersave.yml
- name: powersave tasks
import_tasks: powersave.yml

- name: keychron tasks
import_tasks: keychron.yml
- name: keychron tasks
import_tasks: keychron.yml
tags: ['base']
86 changes: 44 additions & 42 deletions roles/disable-local-dns/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
---
- name: Add DNSStubListener=no to /etc/systemd/resolved.conf
lineinfile:
firstmatch: true
path: "/etc/systemd/resolved.conf"
insertafter: "EOF"
line: "DNSStubListener=no"
state: present
register: dns_default_status
- block:
- name: Add DNSStubListener=no to /etc/systemd/resolved.conf
lineinfile:
firstmatch: true
path: "/etc/systemd/resolved.conf"
insertafter: "EOF"
line: "DNSStubListener=no"
state: present
register: dns_default_status

- name: Print dns_default_status
debug:
var: dns_default_status.changed
- name: Print dns_default_status
debug:
var: dns_default_status.changed

- name: Ensure systemd-resolved is enabled and active
systemd:
name: systemd-resolved.service
enabled: true
state: started
- name: Ensure systemd-resolved is enabled and active
systemd:
name: systemd-resolved.service
enabled: true
state: started

- name: Restart systemd-resolved with validation
command: systemctl restart systemd-resolved.service
register: restart_resolved
retries: 3
delay: 5
until: restart_resolved.rc == 0
when: dns_default_status.changed
- name: Restart systemd-resolved with validation
command: systemctl restart systemd-resolved.service
register: restart_resolved
retries: 3
delay: 5
until: restart_resolved.rc == 0
when: dns_default_status.changed

- name: Ensure systemd-networkd is enabled and active
systemd:
name: systemd-networkd.service
enabled: true
state: started
- name: Ensure systemd-networkd is enabled and active
systemd:
name: systemd-networkd.service
enabled: true
state: started

- name: Restart systemd-networkd with validation
command: systemctl restart systemd-networkd.service
register: restart_networkd
retries: 3
delay: 5
until: restart_networkd.rc == 0
when: dns_default_status.changed
- name: Restart systemd-networkd with validation
command: systemctl restart systemd-networkd.service
register: restart_networkd
retries: 3
delay: 5
until: restart_networkd.rc == 0
when: dns_default_status.changed

- name: Ensure DNS resolution is functional
command: "dig example.com +short"
register: dns_check
retries: 5
delay: 2
until: dns_check.rc == 0
when: dns_default_status.changed
- name: Ensure DNS resolution is functional
command: "dig example.com +short"
register: dns_check
retries: 5
delay: 2
until: dns_check.rc == 0
when: dns_default_status.changed
tags: ['disable-local-dns']
76 changes: 39 additions & 37 deletions roles/env/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
---
- name: install custom_bash.sh / git_bash_ps1.sh to home .bashrc.d directory
copy:
src: "{{ item }}"
dest: "/{{ home_dir }}/.bashrc.d/"
owner: "{{ local_user }}"
group: "{{ local_user_primary_group }}"
mode: "0640"
loop:
- custom_bash.sh
- fzf_config.sh
- git_bash_ps1.sh
- block:
- name: install custom_bash.sh / git_bash_ps1.sh to home .bashrc.d directory
copy:
src: "{{ item }}"
dest: "/{{ home_dir }}/.bashrc.d/"
owner: "{{ local_user }}"
group: "{{ local_user_primary_group }}"
mode: "0640"
loop:
- custom_bash.sh
- fzf_config.sh
- git_bash_ps1.sh

- name: deploy .bashrc / .dircolors to home directory
copy:
src: "{{ item }}"
dest: "/{{ home_dir }}/"
owner: "{{ local_user }}"
group: "{{ local_user_primary_group }}"
mode: "0640"
loop:
- .bashrc
- .dircolors
- name: deploy .bashrc / .dircolors to home directory
copy:
src: "{{ item }}"
dest: "/{{ home_dir }}/"
owner: "{{ local_user }}"
group: "{{ local_user_primary_group }}"
mode: "0640"
loop:
- .bashrc
- .dircolors

- name: install fzf
git:
repo: "https://github.com/junegunn/fzf.git"
dest: "/{{ home_dir }}/.fzf"
depth: "1"
- name: install fzf
git:
repo: "https://github.com/junegunn/fzf.git"
dest: "/{{ home_dir }}/.fzf"
depth: "1"

- name: check if fzf install script has been executed
shell: "/{{ home_dir }}/.fzf/bin/fzf --version"
register: fzf_installed
failed_when: false
changed_when: false
- name: check if fzf install script has been executed
shell: "/{{ home_dir }}/.fzf/bin/fzf --version"
register: fzf_installed
failed_when: false
changed_when: false

#- name: fzf_installed
#debug:
#msg: "{{ fzf_installed }}"
#- name: fzf_installed
#debug:
#msg: "{{ fzf_installed }}"

- name: run fzf install
shell: "/{{ home_dir }}/.fzf/install --key-bindings --completion --no-update-rc"
when: fzf_installed.rc != 0
- name: run fzf install
shell: "/{{ home_dir }}/.fzf/install --key-bindings --completion --no-update-rc"
when: fzf_installed.rc != 0
tags: ['env']
Loading