updated tasks so they are only run once

This commit is contained in:
Matthew Stobbs
2025-03-03 12:04:09 -07:00
parent a2718521a5
commit 2ce49c9b85
117 changed files with 2129 additions and 991 deletions

View File

@@ -1,25 +1,33 @@
# vim: set filetype=yaml.ansible :
---
- name: Enable terra repo for fedora
- name: Add terra
when:
- ansible_distribution == 'Fedora'
- terra_configured is undefined
block:
- name: Enable terra repo for fedora >=41
become: true
when: ansible_distribution_major_version|int >= 41
ansible.builtin.command:
creates: /etc/yum.repos.d/terra.repo
cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig.terrarepo.repo }}"
- name: Enable terra repo for fedora
when:
- ansible_distribution == 'Fedora'
block:
- name: Enable terra repo for fedora >=41
become: true
when: ansible_distribution_major_version|int >= 41
ansible.builtin.command:
creates: /etc/yum.repos.d/terra.repo
cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig.terrarepo.repo }}"
- name: Enable terra repo for fedora < 41
become: true
when: ansible_distribution_major_version|int < 41
ansible.builtin.command:
creates: /etc/yum.repos.d/terra.repo
cmd: "dnf config-manager --add-repo {{ pkgconfig.terrarepo.repo }}"
- name: Enable terra repo for fedora < 41
become: true
when: ansible_distribution_major_version|int < 41
ansible.builtin.command:
creates: /etc/yum.repos.d/terra.repo
cmd: "dnf config-manager --add-repo {{ pkgconfig.terrarepo.repo }}"
- name: Install terra release package
become: true
ansible.builtin.dnf:
name: terra-release
state: present
- name: Install terra release package
become: true
ansible.builtin.dnf:
name: terra-release
state: present
- name: Set terra_configured
ansible.builtin.set_fact:
terra_configured: true