Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new tools #11

Merged
merged 4 commits into from
Sep 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/ansible-lint@v6.20.2
uses: ansible/ansible-lint@main
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
wget-log
.vscode
31 changes: 23 additions & 8 deletions local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
ansible.builtin.import_tasks: handlers/main.yml

pre_tasks:
- name: Update package caches if required (Debian)

- name: End play if the system is not Debian
ansible.builtin.meta: end_play
when: ansible_facts['os_family'] != 'Debian'

- name: Update package caches if required
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
when: ansible_os_family == "Debian"

- name: Update package caches if required (RedHat)
ansible.builtin.yum:
update_cache: true
when: ansible_os_family == "RedHat"

tasks:
- name: Install tools
Expand All @@ -44,7 +43,23 @@
- name: Install NodeJS
ansible.builtin.include_tasks:
file: tasks/nodejs.yml
when: ansible_os_family == "Debian"

# - name: Install brave
# ansible.builtin.include_tasks:
# file: tasks/brave.yml
# NOT TESTED

- name: Install signal
ansible.builtin.include_tasks:
file: tasks/signal.yml

- name: Install spotify
ansible.builtin.include_tasks:
file: tasks/spotify.yml

- name: Install flatpak apps
ansible.builtin.include_tasks:
file: tasks/flathub.yml

- name: Configure Git
ansible.builtin.include_tasks:
Expand Down
20 changes: 20 additions & 0 deletions tasks/brave.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: Download Brave browser GPG key

Check failure on line 1 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (get_url).
get_url:
url: https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
dest: /usr/share/keyrings/brave-browser-archive-keyring.gpg
mode: '0644'

- name: Add Brave browser repository

Check failure on line 7 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (lineinfile).

Check failure on line 7 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

risky-file-permissions

File permissions unset or incorrect.
lineinfile:
path: /etc/apt/sources.list.d/brave-browser-release.list
line: "deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"
create: yes

Check failure on line 11 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[truthy]

Truthy value should be one of \[false, true]

- name: Update APT package index

Check failure on line 13 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (apt).
apt:
update_cache: yes

Check failure on line 15 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[truthy]

Truthy value should be one of \[false, true]

- name: Install Brave browser

Check failure on line 17 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (apt).
apt:
name: brave-browser
state: present

Check failure on line 20 in tasks/brave.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[new-line-at-end-of-file]

No new line character at the end of file
16 changes: 16 additions & 0 deletions tasks/flathub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Add or update Flathub remote
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
method: user
become: false

- name: Install packages from flathub
community.general.flatpak:
name:
- org.mozilla.Thunderbird
- com.notesnook.Notesnook
method: user
become: false
5 changes: 3 additions & 2 deletions tasks/install-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
- gpg
- net-tools
- zip
state: latest
- vlc
state: present

- name: Upgrade pip
ansible.builtin.pip:
name: pip
state: latest
state: present
vars:
ansible_python_interpreter: /usr/bin/python3
30 changes: 30 additions & 0 deletions tasks/signal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
- name: Download Signal GPG key and add to keyring

Check failure on line 2 in tasks/signal.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

command-instead-of-module

wget used in place of get_url or uri module

Check failure on line 2 in tasks/signal.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

risky-shell-pipe

Shells that use pipes should set the pipefail option.
ansible.builtin.shell:
cmd: "wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > /tmp/signal-desktop-keyring.gpg"
args:
creates: /tmp/signal-desktop-keyring.gpg

- name: Move GPG key to /usr/share/keyrings
ansible.builtin.copy:
src: /tmp/signal-desktop-keyring.gpg
dest: /usr/share/keyrings/signal-desktop-keyring.gpg
remote_src: false
owner: root
group: root
mode: '0644'

- name: Add Signal repository to apt sources
ansible.builtin.apt_repository:
repo: "deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main"
state: present
filename: signal-xenial

- name: Update APT package index
ansible.builtin.apt:
update_cache: true

- name: Install Signal Desktop
ansible.builtin.apt:
name: signal-desktop
state: present
21 changes: 21 additions & 0 deletions tasks/spotify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Add Spotify GPG key
ansible.builtin.shell: >
curl -sS https://download.spotify.com/debian/pubkey_6224F9941A8AA6D1.gpg | gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg
args:
creates: /etc/apt/trusted.gpg.d/spotify.gpg

- name: Add Spotify repository
ansible.builtin.lineinfile:
path: /etc/apt/sources.list.d/spotify.list
line: 'deb http://repository.spotify.com stable non-free'
create: true

- name: Update APT package index
ansible.builtin.apt:
update_cache: true

- name: Install Spotify client
ansible.builtin.apt:
name: spotify-client
state: present
3 changes: 0 additions & 3 deletions tasks/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
url: https://apt.releases.hashicorp.com/gpg
state: present
keyring: /etc/apt/trusted.gpg.d/hashicorp.gpg
when: ansible_os_family == "Debian"

- name: Add hashicorp repository
ansible.builtin.apt_repository:
repo: deb [arch=amd64] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main
state: present
when: ansible_os_family == "Debian"

- name: Install Terraform
ansible.builtin.apt:
name: terraform
state: present
update_cache: true
when: ansible_os_family == "Debian"

- name: Enable autocomplete for Terraform
ansible.builtin.lineinfile:
Expand Down
19 changes: 19 additions & 0 deletions tasks/vscode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Add Microsoft GPG key
ansible.builtin.apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc
state: present

- name: Add VSCode repository
ansible.builtin.apt_repository:
repo: 'deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main'
state: present

- name: Update APT package index
ansible.builtin.apt:
update_cache: true

- name: Install Visual Studio Code
ansible.builtin.apt:
name: code
state: present