Initial commit of roles-refactor branch
This commit is contained in:
13
roles/arch_update/tasks/aur_upgrade.yaml
Normal file
13
roles/arch_update/tasks/aur_upgrade.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: AUR upgrade
|
||||
aur:
|
||||
use: pikaur
|
||||
upgrade: true
|
||||
aur_only: true
|
||||
|
||||
- name: Rebuild AUR Python packages if version changed
|
||||
ansible.builtin.import_tasks: aur_rebuild.yml
|
||||
vars:
|
||||
package_pattern: python
|
||||
when: new_python is version(orig_python, '>', version_type='strict')
|
||||
|
||||
17
roles/arch_update/tasks/main.yaml
Normal file
17
roles/arch_update/tasks/main.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Get original Python version
|
||||
ansible.builtin.include_tasks: python_check.yaml
|
||||
vars:
|
||||
target_var: orig_python
|
||||
|
||||
- name: Perform official repository updates
|
||||
ansible.builtin.import_tasks: repo_upgrade.yaml
|
||||
|
||||
- name: Get new Python version
|
||||
ansible.builtin.include_tasks: python_check.yaml
|
||||
vars:
|
||||
target_var: new_python
|
||||
|
||||
- name: Perform AUR updates and rebuilds
|
||||
ansible.builtin.import_tasks: aur_update.yml
|
||||
|
||||
11
roles/arch_update/tasks/python_check.yaml
Normal file
11
roles/arch_update/tasks/python_check.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: Run Python version command
|
||||
ansible.builtin.shell:
|
||||
cmd: python --version | grep -Po '\d+\.\d+'
|
||||
register: _temp_python_version
|
||||
changed_when: false
|
||||
|
||||
- name: Assign version to dynamic variable
|
||||
ansible.builtin.set_fact:
|
||||
"{{ target_var }}": "{{ _temp_python_version.stdout }}"
|
||||
|
||||
5
roles/arch_update/tasks/repo_upgrade.yaml
Normal file
5
roles/arch_update/tasks/repo_upgrade.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: Full repository upgrade
|
||||
become: true
|
||||
community.general.pacman:
|
||||
update_cache: true
|
||||
upgrade: true
|
||||
Reference in New Issue
Block a user