ansible: split common and common-node roles
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 5 Jun 2023 19:18:31 +0000 (15:18 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Wed, 7 Jun 2023 21:10:29 +0000 (17:10 -0400)
To keep the roles self-contained, split the 'common' role into a
'common-node' role.

Change-Id: Ifade97c647cc0e9b480d765caf02a225397de6da
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
28 files changed:
automation/ansible/group_vars/node.yml
automation/ansible/node_all.yml
automation/ansible/node_amd64.yml
automation/ansible/node_arm64.yml
automation/ansible/node_armhf.yml
automation/ansible/node_el.yml
automation/ansible/node_i386.yml
automation/ansible/node_ppc64el.yml
automation/ansible/node_sles.yml
automation/ansible/node_standalone.yml
automation/ansible/roles/common-node/tasks/main.yml [new file with mode: 0644]
automation/ansible/roles/common-node/tasks/setup-Alpine.yml [new file with mode: 0644]
automation/ansible/roles/common-node/tasks/setup-Debian.yml [new file with mode: 0644]
automation/ansible/roles/common-node/tasks/setup-RedHat.yml [new file with mode: 0644]
automation/ansible/roles/common-node/tasks/setup-Suse.yml [new file with mode: 0644]
automation/ansible/roles/common-node/vars/Alpine.yml [new file with mode: 0644]
automation/ansible/roles/common-node/vars/CentOS-7.yml [new file with mode: 0644]
automation/ansible/roles/common-node/vars/Debian.yml [new file with mode: 0644]
automation/ansible/roles/common-node/vars/RedHat.yml [new file with mode: 0644]
automation/ansible/roles/common-node/vars/Rocky.yml [new symlink]
automation/ansible/roles/common-node/vars/SLES-15.yml [new file with mode: 0644]
automation/ansible/roles/common-node/vars/Suse.yml [new file with mode: 0644]
automation/ansible/roles/common/tasks/setup-Debian.yml
automation/ansible/roles/common/vars/Alpine.yml
automation/ansible/roles/common/vars/CentOS-7.yml
automation/ansible/roles/common/vars/RedHat.yml
automation/ansible/roles/common/vars/SLES-15.yml
automation/ansible/roles/common/vars/Suse.yml

index 3a17f75f88316380e10f2a2f64584cb82f4e864a..02a0ca6fcee84d1a68e58d0334c1744c84612800 100644 (file)
@@ -1,22 +1,2 @@
 ---
 jenkins_user: true
-packages_Debian:
-  - autoconf
-  - automake
-  - bison
-  - build-essential
-  - clang
-  - clang-tools
-  - cloc
-  - default-jdk-headless
-  - flex
-  - gettext
-  - git
-  - libssl-dev
-  - libtap-harness-archive-perl
-  - libtool-bin
-  - lzop
-  - pbzip2
-  - sudo
-  - vim
-  - virtualenv
index 849557c35eb8405a6c761bb991ad3407587d58c1..31b2e1113933c4bcf55be128704f39050c8a6400 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: all
   roles:
     - common
+    - common-node
     - cross-compilers
     - compilers
     - babeltrace
index 6ceb1b3ecf27c4ce26792362eca107ef09c21e95..427ba7ec8576e20cb2501e7b6082ab40ee39facd 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_amd64
   roles:
     - common
+    - common-node
     - cross-compilers
     - compilers
     - babeltrace
index d5954f34a963d9089b2af91618112991ead697ae..fd39716e650dd76b738b3ab784c455dd67b31d9c 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_arm64
   roles:
     - common
+    - common-node
     - babeltrace
     - liburcu
     - lttng-ust
index 9591ee46cf62a027f33805496eaff3ed0400431c..2ae2ca407b7e3746c2f0f168aff90595e663a188 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_armhf
   roles:
     - common
+    - common-node
     - babeltrace
     - liburcu
     - lttng-ust
index e6d658b3ec5642abd9d062bb65bae5d85ddc1e44..96b5f044fb0af45967f488f5ecc88a624acd66d2 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_el
   roles:
     - common
+    - common-node
     - babeltrace
     - liburcu
     - lttng-ust
index 6e18d1308354d71e76cb1aa8aec5651c2d8b817d..eb842449b18359a6d9add5b9d4ceb2ecd31c8d9f 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_i386
   roles:
     - common
+    - common-node
     - babeltrace
     - liburcu
     - lttng-ust
index b0a3d3c01d633b09b69f84086c8f85b6ae6df8cd..62dc4d5b92d1b8dfca35e9d66f87f86bd234bdbf 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_ppc64el
   roles:
     - common
+    - common-node
     - babeltrace
     - liburcu
     - lttng-ust
index c403d7c9a0fc61a47ee37423cd020cc43d041422..5ad9454f30a36d370f3e093718dd99038a7359d6 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_sles
   roles:
     - common
+    - common-node
     - babeltrace
     - liburcu
     - lttng-ust
index 325b5d4831cd50ef5db0719813b99431b6a37e05..e97f6c4ff38a6d36e11e6c75f8f2b37514d34096 100644 (file)
@@ -1,6 +1,7 @@
 - hosts: node_standalone
   roles:
     - common
+    - common-node
     - cross-compilers
     - babeltrace
     - liburcu
diff --git a/automation/ansible/roles/common-node/tasks/main.yml b/automation/ansible/roles/common-node/tasks/main.yml
new file mode 100644 (file)
index 0000000..177603e
--- /dev/null
@@ -0,0 +1,22 @@
+---
+# Include variables and define needed variables.
+- name: Include OS-specific variables.
+  include_vars: "{{ item }}"
+  with_first_found:
+    - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml"
+    - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
+    - "{{ ansible_distribution }}.yml"
+    - "{{ ansible_os_family }}.yml"
+
+# Setup/install tasks.
+- include: setup-RedHat.yml
+  when: ansible_os_family in ['RedHat', 'Rocky']
+
+- include: setup-Debian.yml
+  when: ansible_os_family == 'Debian'
+
+- include: setup-Alpine.yml
+  when: ansible_os_family == 'Alpine'
+
+- include: setup-Suse.yml
+  when: ansible_os_family == 'Suse'
diff --git a/automation/ansible/roles/common-node/tasks/setup-Alpine.yml b/automation/ansible/roles/common-node/tasks/setup-Alpine.yml
new file mode 100644 (file)
index 0000000..17196f1
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: Update apk cache.
+  apk: update_cache=yes
+
+- name: Ensure common_node packages are installed.
+  apk: "name={{ common_node_packages }} state=present"
diff --git a/automation/ansible/roles/common-node/tasks/setup-Debian.yml b/automation/ansible/roles/common-node/tasks/setup-Debian.yml
new file mode 100644 (file)
index 0000000..e390f9d
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: Update apt cache.
+  apt: update_cache=yes cache_valid_time=86400
+
+- name: Ensure common_node packages are installed.
+  apt: "name={{ common_node_packages }} state=present"
diff --git a/automation/ansible/roles/common-node/tasks/setup-RedHat.yml b/automation/ansible/roles/common-node/tasks/setup-RedHat.yml
new file mode 100644 (file)
index 0000000..b448251
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: Ensure common_node packages are installed.
+  dnf:
+    name: "{{ common_node_packages }}"
+    state: installed
+    install_weak_deps: false
diff --git a/automation/ansible/roles/common-node/tasks/setup-Suse.yml b/automation/ansible/roles/common-node/tasks/setup-Suse.yml
new file mode 100644 (file)
index 0000000..b1c3cd5
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: Ensure common_node patterns are installed.
+  zypper: "name={{ common_node_patterns }} type=pattern state=present update_cache=yes"
+
+- name: Ensure common_node packages are installed.
+  zypper: "name={{ common_node_packages }} type=package state=present update_cache=yes"
diff --git a/automation/ansible/roles/common-node/vars/Alpine.yml b/automation/ansible/roles/common-node/vars/Alpine.yml
new file mode 100644 (file)
index 0000000..225b074
--- /dev/null
@@ -0,0 +1,26 @@
+---
+common_node_packages:
+  - alpine-sdk
+  - autoconf
+  - automake
+  - bash
+  - bison
+  - clang
+  - cloc
+  - coreutils
+  - curl
+  - flex
+  - gettext
+  - git
+  - htop
+  - jq
+  - libtool
+  - openjdk11
+  - openssl-dev
+  - perl
+  - py-virtualenv
+  - rsync
+  - shadow
+  - sudo
+  - tree
+  - vim
diff --git a/automation/ansible/roles/common-node/vars/CentOS-7.yml b/automation/ansible/roles/common-node/vars/CentOS-7.yml
new file mode 100644 (file)
index 0000000..df50f3a
--- /dev/null
@@ -0,0 +1,28 @@
+---
+common_node_packages:
+  - autoconf
+  - automake
+  - bison
+  - clang
+  - curl
+  - emacs-nox
+  - flex
+  - gcc
+  - gcc-c++
+  - gettext
+  - git
+  - java-11-openjdk-devel
+  - java-11-openjdk-headless
+    #  - jq
+  - libtool
+  - lzop
+  - make
+  - openssh-server
+  - openssl-devel
+  - perl-Test-Harness
+  - psmisc
+  - python-virtualenv
+  - rsync
+  - sudo
+  - tree
+  - vim
diff --git a/automation/ansible/roles/common-node/vars/Debian.yml b/automation/ansible/roles/common-node/vars/Debian.yml
new file mode 100644 (file)
index 0000000..39c2a3a
--- /dev/null
@@ -0,0 +1,29 @@
+---
+common_node_packages:
+  - autoconf
+  - automake
+  - bison
+  - build-essential
+  - clang
+  - clang-tools
+  - cloc
+  - curl
+  - default-jdk-headless
+  - emacs-nox
+  - flex
+  - gettext
+  - git
+  - htop
+  - jq
+  - libssl-dev
+  - libtap-harness-archive-perl
+  - libtool-bin
+  - lzop
+  - openssh-server
+  - pbzip2
+  - psmisc
+  - rsync
+  - sudo
+  - tree
+  - vim
+  - virtualenv
diff --git a/automation/ansible/roles/common-node/vars/RedHat.yml b/automation/ansible/roles/common-node/vars/RedHat.yml
new file mode 100644 (file)
index 0000000..4867365
--- /dev/null
@@ -0,0 +1,29 @@
+---
+common_node_packages:
+  - autoconf
+  - automake
+  - bison
+  - clang
+  - curl
+  - emacs-nox
+  - flex
+  - gcc
+  - gcc-c++
+  - gettext
+  - git
+  - htop
+  - java-11-openjdk-devel
+  - java-11-openjdk-headless
+  - jq
+  - libtool
+  - lzop
+  - make
+  - openssh-server
+  - openssl-devel
+  - perl-Test-Harness
+  - psmisc
+  - python3-virtualenv
+  - rsync
+  - sudo
+  - tree
+  - vim
diff --git a/automation/ansible/roles/common-node/vars/Rocky.yml b/automation/ansible/roles/common-node/vars/Rocky.yml
new file mode 120000 (symlink)
index 0000000..f802000
--- /dev/null
@@ -0,0 +1 @@
+RedHat.yml
\ No newline at end of file
diff --git a/automation/ansible/roles/common-node/vars/SLES-15.yml b/automation/ansible/roles/common-node/vars/SLES-15.yml
new file mode 100644 (file)
index 0000000..693f0f3
--- /dev/null
@@ -0,0 +1,26 @@
+---
+common_node_patterns:
+  - base
+  - devel_basis
+
+common_node_packages:
+  - autoconf
+  - automake
+  - bison
+  - curl
+  - flex
+  - gettext-runtime
+  - git-core
+  - java-11-openjdk-devel
+  - java-11-openjdk-headless
+  - jq
+  - libopenssl-devel
+#  - libtap-harness-archive-perl
+  - libtool
+  - openssh
+  - psmisc
+#  - python-virtualenv
+  - rsync
+  - sudo
+#  - tree
+  - vim
diff --git a/automation/ansible/roles/common-node/vars/Suse.yml b/automation/ansible/roles/common-node/vars/Suse.yml
new file mode 100644 (file)
index 0000000..4e13642
--- /dev/null
@@ -0,0 +1,26 @@
+---
+common_node_patterns:
+  - base
+  - Minimal
+  - Basis-Devel
+
+common_node_packages:
+  - autoconf
+  - automake
+  - bison
+  - curl
+  - flex
+  - gettext-runtime
+  - git-core
+  - java-11-openjdk-devel
+  - java-11-openjdk-headless
+#  - jq
+  - libopenssl-devel
+#  - libtap-harness-archive-perl
+  - libtool
+  - openssh
+  - psmisc
+#  - python-virtualenv
+  - sudo
+  - tree
+  - vim
index 54a7a4f9cfeeb162813a78494d204960735c82ad..0f70202a8e208e652d89793d1823a5d30dc2c844 100644 (file)
@@ -20,8 +20,4 @@
   apt: update_cache=yes cache_valid_time=86400
 
 - name: Ensure common packages are installed.
-  apt: "name={{ common_packages + packages_Debian|default([]) }} state=present"
-
-- name: Debug common packages
-  debug:
-    msg: "{{ common_packages + packages_Debian|default([]) }}"
+  apt: "name={{ common_packages }} state=present"
index 6d048312414740966aba358c9a7aed5af9174e9f..06f2d9d6644ba26be71fa807287b16432a416811 100644 (file)
@@ -1,23 +1,10 @@
 ---
 common_packages:
-  - alpine-sdk
-  - autoconf
-  - automake
   - bash
-  - bison
-  - clang
-  - cloc
   - coreutils
   - curl
-  - flex
-  - gettext
   - git
   - htop
-  - jq
-  - libtool
-  - openjdk11
-  - openssl-dev
-  - perl
   - py-virtualenv
   - rsync
   - shadow
index 66b672286fd1635d21d45b6fa8fc8a960dbaeeb9..bda232bb206c59589b00c90ea27af1ab570209b5 100644 (file)
@@ -1,25 +1,10 @@
 ---
 common_packages:
-  - autoconf
-  - automake
-  - bison
-  - clang
   - curl
   - emacs-nox
-  - flex
-  - gcc
-  - gcc-c++
-  - gettext
   - git
-  - java-11-openjdk-devel
-  - java-11-openjdk-headless
-    #  - jq
-  - libtool
   - lzop
-  - make
   - openssh-server
-  - openssl-devel
-  - perl-Test-Harness
   - psmisc
   - python-virtualenv
   - rsync
index 273dd1b1998591a7863daad5082180597390f213..3c3a99725b53988917aa34d8ee2c52e1247781a9 100644 (file)
@@ -1,26 +1,11 @@
 ---
 common_packages:
-  - autoconf
-  - automake
-  - bison
-  - clang
   - curl
   - emacs-nox
-  - flex
-  - gcc
-  - gcc-c++
-  - gettext
   - git
   - htop
-  - java-11-openjdk-devel
-  - java-11-openjdk-headless
-  - jq
-  - libtool
   - lzop
-  - make
   - openssh-server
-  - openssl-devel
-  - perl-Test-Harness
   - psmisc
   - python3-virtualenv
   - rsync
index 42e39892b1436139607207d1ad4e6ce73b666232..8330b4e83c0a4c7be39eb86fc2fd8a5c59168fea 100644 (file)
@@ -1,26 +1,12 @@
 ---
 common_patterns:
   - base
-  - devel_basis
 
 common_packages:
-  - autoconf
-  - automake
-  - bison
   - curl
-  - flex
-  - gettext-runtime
   - git-core
-  - java-11-openjdk-devel
-  - java-11-openjdk-headless
-  - jq
-  - libopenssl-devel
-#  - libtap-harness-archive-perl
-  - libtool
   - openssh
   - psmisc
-#  - python-virtualenv
   - rsync
   - sudo
-#  - tree
   - vim
index acf1ec60332d5e35d09d742fd2a1c692043be93f..17ad4fc7373aad07e964faf8d6568fb7408917e3 100644 (file)
@@ -2,25 +2,12 @@
 common_patterns:
   - base
   - Minimal
-  - Basis-Devel
 
 common_packages:
-  - autoconf
-  - automake
-  - bison
   - curl
-  - flex
-  - gettext-runtime
   - git-core
-  - java-11-openjdk-devel
-  - java-11-openjdk-headless
-#  - jq
-  - libopenssl-devel
-#  - libtap-harness-archive-perl
-  - libtool
   - openssh
   - psmisc
-#  - python-virtualenv
   - sudo
   - tree
   - vim
This page took 0.032542 seconds and 4 git commands to generate.