ansible: Use 'compilers_legacy_install' to control legacy CC installation
authorKienan Stewart <kstewart@efficios.com>
Tue, 24 Oct 2023 20:26:28 +0000 (16:26 -0400)
committerKienan Stewart <kstewart@efficios.com>
Fri, 10 Nov 2023 16:46:55 +0000 (11:46 -0500)
Change-Id: Ib82813759364dd7227206f3dd4e6d8d95b720b2e

automation/ansible/roles/cross-compilers/defaults/main.yml [new file with mode: 0644]
automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml
automation/ansible/roles/cross-compilers/vars/Debian.yml

diff --git a/automation/ansible/roles/cross-compilers/defaults/main.yml b/automation/ansible/roles/cross-compilers/defaults/main.yml
new file mode 100644 (file)
index 0000000..d50918b
--- /dev/null
@@ -0,0 +1,3 @@
+---
+compilers_legacy_install: true
+cross_compilers_debian_bookworm_snapshot: false
index dfc2a719090108277dfa9e325dfb236ec68b83a8..a03cfa9de0e4006e055ae2e60b510be997d2bb00 100644 (file)
@@ -8,8 +8,10 @@
     - ansible.builtin.copy:
         dest: /etc/apt/preferences.d/snapshot.pref
         content: "Package: *\nPin: origin \"snapshot.debian.org\"\nPin-Priority: 400\n"
+      when: cross_compilers_debian_bookworm_snapshot
     - ansible.builtin.apt_repository:
         repo: 'deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/20230109T091852Z/ bookworm main'
+        state: "{{cross_compilers_debian_bookworm_snapshot|ternary('present', 'absent')}}"
     - ansible.builtin.apt:
         update_cache: true
 
@@ -17,7 +19,7 @@
   apt: "name={{ cross_compilers_packages }} state=present"
 
 - name: Install legacy cross compilers
-  when: ansible_distribution == 'Debian' and ansible_architecture == 'x86_64'
+  when: ansible_distribution == 'Debian' and ansible_architecture == 'x86_64' and compilers_legacy_install
   block:
     # This step needs to happen after the cross compiler packages are installed
     # so the libgcc cross libraries can be copied
index a4bca80b4e941db8cde1673fd7997e9b24b01673..32a8a3504f8522b68b9896f6d172ee32e21059b5 100644 (file)
@@ -23,3 +23,4 @@ cross_compilers_packages:
   # be fetched from a snapshot source instead
   - gcc-11-powerpc-linux-gnu
   - gcc-11-riscv64-linux-gnu
+cross_compilers_debian_bookworm_snapshot: true
This page took 0.024009 seconds and 4 git commands to generate.