diff --git a/README.md b/README.md index b58d1f9..f7105b6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ - Cool neovim setup - strawberry - fuzzy find -- keepassxc config - thunderbird config - some kind of tag setup with: bootstrap, update etc - sync music collection diff --git a/roles/asdf/meta/main.yml b/roles/asdf/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/asdf/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/asdf/tasks/main.yml b/roles/asdf/tasks/main.yml index cd5b6c2..29830c4 100644 --- a/roles/asdf/tasks/main.yml +++ b/roles/asdf/tasks/main.yml @@ -5,9 +5,6 @@ - name: Install Erlang prerequisite APT packages become: true apt: - state: present - update_cache: true - cache_valid_time: 86400 # One day pkg: - build-essential - autoconf @@ -33,9 +30,6 @@ - name: Install Elixir prerequisite APT packages become: true apt: - state: present - update_cache: true - cache_valid_time: 86400 # One day name: unzip - name: Install asdf Elixir plugin shell: diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml new file mode 100644 index 0000000..089b0de --- /dev/null +++ b/roles/common/tasks/main.yml @@ -0,0 +1,8 @@ +- name: APT upgrade + become: true + apt: + autoremove: true + upgrade: yes + state: latest + update_cache: yes + cache_valid_time: 86400 # One day diff --git a/roles/neovim/meta/main.yml b/roles/neovim/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/neovim/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/neovim/tasks/main.yml b/roles/neovim/tasks/main.yml index d8b2972..85303eb 100644 --- a/roles/neovim/tasks/main.yml +++ b/roles/neovim/tasks/main.yml @@ -8,9 +8,12 @@ become: true apt_repository: repo: "deb [signed-by=/etc/apt/keyrings/neovim.gpg] https://ppa.launchpadcontent.net/neovim-ppa/stable/ubuntu {{ ansible_distribution_release }} main" - state: present + register: apt_repository +- name: Update APT cache + apt: + update_cache: true + when: apt_repository.changed - name: Install Neovim become: true apt: name: neovim - state: present diff --git a/roles/signal/meta/main.yml b/roles/signal/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/signal/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/signal/tasks/main.yml b/roles/signal/tasks/main.yml index 6b6f011..fa3d584 100644 --- a/roles/signal/tasks/main.yml +++ b/roles/signal/tasks/main.yml @@ -7,11 +7,12 @@ become: true apt_repository: repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/signal.asc] https://updates.signal.org/desktop/apt xenial main" - state: present + register: apt_repository +- name: Update APT cache + apt: + update_cache: true + when: apt_repository.changed - name: Install Signal become: true apt: - state: latest - update_cache: yes - cache_valid_time: 86400 # One day name: signal-desktop diff --git a/roles/syncthing/meta/main.yml b/roles/syncthing/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/syncthing/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/syncthing/tasks/main.yml b/roles/syncthing/tasks/main.yml index 31f05e9..ec6069c 100644 --- a/roles/syncthing/tasks/main.yml +++ b/roles/syncthing/tasks/main.yml @@ -1,9 +1,6 @@ - name: Install Syncthing become: true apt: - state: latest - update_cache: true - cache_valid_time: 86400 name: syncthing - name: Create Syncthing configuration directory file: diff --git a/roles/system/meta/main.yml b/roles/system/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/system/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/system/tasks/main.yml b/roles/system/tasks/main.yml index d13e6c3..578cac0 100644 --- a/roles/system/tasks/main.yml +++ b/roles/system/tasks/main.yml @@ -1,14 +1,6 @@ -- name: Update repositories - become: true - apt: - upgrade: yes - state: latest - update_cache: yes - cache_valid_time: 86400 # One day - name: Install APT packages become: true apt: - state: latest pkg: - git - make diff --git a/roles/virtualbox/meta/main.yml b/roles/virtualbox/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/virtualbox/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/virtualbox/tasks/main.yml b/roles/virtualbox/tasks/main.yml index 0421e35..217649d 100644 --- a/roles/virtualbox/tasks/main.yml +++ b/roles/virtualbox/tasks/main.yml @@ -7,11 +7,12 @@ become: true apt_repository: repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/oracle_vbox_2016.asc] https://download.virtualbox.org/virtualbox/debian {{ ansible_distribution_release }} contrib" - state: present + register: apt_repository +- name: Update APT cache + apt: + update_cache: true + when: apt_repository.changed - name: Install VirtualBox become: true apt: - state: latest - update_cache: yes - cache_valid_time: 86400 # One day name: virtualbox-6.1 diff --git a/roles/vscodium/meta/main.yml b/roles/vscodium/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/vscodium/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/vscodium/tasks/main.yml b/roles/vscodium/tasks/main.yml index 3103951..3a7b3b6 100644 --- a/roles/vscodium/tasks/main.yml +++ b/roles/vscodium/tasks/main.yml @@ -7,13 +7,14 @@ become: true apt_repository: repo: "deb [signed-by=/etc/apt/trusted.gpg.d/vscodium-archive-keyring.asc ] https://download.vscodium.com/debs vscodium main" - state: present + register: apt_repository +- name: Update APT cache + apt: + update_cache: true + when: apt_repository.changed - name: Install VSCodium become: true apt: - state: latest - update_cache: yes - cache_valid_time: 86400 # One day name: codium - name: Check VSCodium extensions setup: diff --git a/roles/zsh/meta/main.yml b/roles/zsh/meta/main.yml new file mode 100644 index 0000000..9711b33 --- /dev/null +++ b/roles/zsh/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - role: common diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml index 78e97f4..2da4a25 100644 --- a/roles/zsh/tasks/main.yml +++ b/roles/zsh/tasks/main.yml @@ -1,9 +1,6 @@ - name: Install zsh become: true apt: - state: latest - update_cache: yes - cache_valid_time: 86400 # One day name: zsh - name: Set default shell to zsh become: true