ansible: Add missing default variables for common-node
[lttng-ci.git] / automation / ansible / roles / common / tasks / main.yml
index d8c53828cc9c125a4f2598818ac613cd4873bbf5..6a562d4b8a9cf9e5c970be8593ac91b5cdedba07 100644 (file)
@@ -1,40 +1,32 @@
 ---
 # Include variables and define needed variables.
 - name: Include OS-specific variables.
-  include_vars: "{{ ansible_os_family }}.yml"
-
-- name: Define common_packages.
-  set_fact:
-    common_packages: "{{ __common_packages | list }}"
-  when: common_packages is not defined
+  ansible.builtin.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 == 'RedHat'
+- ansible.builtin.include_tasks: setup-RedHat.yml
+  when: ansible_os_family in ['RedHat', 'Rocky']
 
-- include: setup-Debian.yml
+- ansible.builtin.include_tasks: setup-Debian.yml
   when: ansible_os_family == 'Debian'
 
-- name: Create sudoers.d directory.
-  file:
-    path: /etc/sudoers.d
-    owner: root
-    group: root
-    mode: 0755
-    state: directory
+- ansible.builtin.include_tasks: setup-Alpine.yml
+  when: ansible_os_family == 'Alpine'
+
+- ansible.builtin.include_tasks: setup-Suse.yml
+  when: ansible_os_family == 'Suse'
+
+- ansible.builtin.include_tasks: setup-Windows.yml
+  when: ansible_os_family == 'Windows'
 
-- name: Set includedir in /etc/sudoers.
-  lineinfile:
-    dest: /etc/sudoers
-    line: "#includedir /etc/sudoers.d"
-    state: present
-    validate: "/usr/sbin/visudo -cf %s"
+# Setup user accounts
+- ansible.builtin.include_tasks: users.yml
+  when: ansible_os_family != 'Windows'
 
-- name: Create jenkins sudoers file.
-  copy:
-    dest: "/etc/sudoers.d/jenkins"
-    content: "jenkins ALL=NOPASSWD: ALL"
-    mode: 0440
-    owner: root
-    group: root
-    validate: "/usr/sbin/visudo -cf %s"
+- ansible.builtin.include_tasks: users-Windows.yml
+  when: ansible_os_family == 'Windows'
This page took 0.02439 seconds and 4 git commands to generate.