This commit is contained in:
2022-07-28 16:25:19 -05:00
parent d36bc83ee7
commit d11e59fa0f
4 changed files with 65 additions and 58 deletions

View File

@@ -1,62 +1,6 @@
---
- hosts: localhost
tags: always
connection: local
become: true
pre_tasks:
- name: pre-run | update package cache (arch)
tags: always
pacman: update_cache=yes
changed_when: False
when: ansible_distribution == "Archlinux"
- name: pre-run | update package cache (debian, etc)
tags: always
apt: update_cache=yes
changed_when: False
when: ansible_distribution in ["Debian", "Ubuntu"]
tasks:
- name: install packages
package:
name:
- htop
- name: set wallpaper
become_user: user
dconf:
key: "/org/gnome/desktop/background/picture-uri-dark"
value: "'file:///usr/share/backgrounds/pop/kate-hazen-fractal-mountains.png'"
- name: set wallpaper position
become_user: user
dconf:
key: "/org/gnome/desktop/background/picture-options"
value: "'zoom'"
- name: copy .zshrc file
copy:
src: files/zshrc
dest: /home/user/.zshrc
owner: user
group: user
- name: add ansible user
user:
name: ansible
system: yes
- name: set up sudo for ansible user
copy:
src: files/sudoers_ansible
dest: /etc/sudoers.d/ansible
owner: root
group: root
mode: 0440
- name: add ansible-pull cron job
cron:
name: ansible auto-provision
user: ansible
minute: "*/10"
job: ansible-pull -o -U https://github.com/DeveloperDurp/DesktopAnsible.git
roles:
- packages

View File

@@ -0,0 +1,24 @@
- name: add apt repository key
apt_key:
url: "{{ item }}"
with_items: "{{ apt_keys }}"
become: yes
- name: add apt repository
apt_repository:
repo: "{{ item }}"
with_items: "{{ apt_repo }}"
become: yes
- name: Upgrade Packages
package:
update_cache: yes
upgrade: safe
become: yes
- name: Install Packages
apt:
state: latest
update_cache: yes
pkg: "{{ required_packages }}"
become: yes

View File

@@ -0,0 +1,9 @@
- name: Load a variable file based on the OS type
include_vars: "{{ item }}"
with_first_found:
- "./roles/packages/vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "./roles/packages/vars/{{ ansible_distribution }}.yml"
- "./roles/packages/vars/defaults.yml"
- name:
include_tasks: "{{ ansible_distribution }}.yml"

View File

@@ -0,0 +1,30 @@
required_packages:
- git
- zsh
- nfs-common
- dotnet-sdk-6.0
- powershell
- kubectl
- podman
- octopuscli
- nodejs
- terraform
- yarn
- helm
- htop
- azure-cli
apt_keys:
- https://packages.cloud.google.com/apt/doc/apt-key.gpg
- http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key
- https://apt.octopus.com/public.key
- https://apt.releases.hashicorp.com/gpg
- https://baltocdn.com/helm/signing.asc
- https://packages.microsoft.com/keys/microsoft.asc
apt_repo:
- deb https://apt.kubernetes.io/ kubernetes-xenial main
- deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/ /
- deb https://apt.octopus.com/ stable main
- deb [arch=amd64] https://apt.releases.hashicorp.com jammy main
- deb https://baltocdn.com/helm/stable/debian/ all main
- deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ jammy main
- deb [arch=amd64] https://packages.microsoft.com/ubuntu/22.04/prod jammy main