From c3e60005d1f600133972f98b93ad161ad0fb254d Mon Sep 17 00:00:00 2001 From: willtome Date: Mon, 14 Feb 2022 14:20:04 -0500 Subject: [PATCH] add system roles playbook --- collections/requirements.yml | 3 ++- linux/setup.yml | 25 +++++++++++++++++++++++++ linux/system_roles.yml | 13 +++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 linux/system_roles.yml diff --git a/collections/requirements.yml b/collections/requirements.yml index 2a024e9..073eb94 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,8 +1,9 @@ --- collections: - - ansible.controller + - ansible.controller:4.1.1 - redhat_cop.controller_configuration #linux - redhat.insights + - redhat.rhel_system_roles - community.general - containers.podman \ No newline at end of file diff --git a/linux/setup.yml b/linux/setup.yml index 7ef7928..b5df674 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -216,6 +216,31 @@ controller_templates: credentials: - "Workshop Credential" survey_enabled: true + survey: + name: '' + description: '' + spec: + - question_name: Server Name or Pattern + type: text + variable: HOSTS + required: true + - question_name: Web Page Message + type: textarea + variable: message + required: true + - name: "LINUX / System Roles" + job_type: run + inventory: "Workshop Inventory" + project: "Ansible official demo project" + playbook: "linux/system_roles.yml" + execution_environment: Default execution environment + diff_mode: yes + ask_job_type_on_launch: yes + extra_vars: + system_roles: undef + credentials: + - "Workshop Credential" + survey_enabled: true survey: name: '' description: '' diff --git a/linux/system_roles.yml b/linux/system_roles.yml new file mode 100644 index 0000000..f58f79f --- /dev/null +++ b/linux/system_roles.yml @@ -0,0 +1,13 @@ +--- +- name: Apply RHEL System Roles + hosts: "{{ HOSTS }}" + vars: + system_roles: undef + + tasks: + - name: Apply System Roles + include_role: + name: "redhat_cop.controller_configuration.{{ item }}" + loop: "{{ system_roles }}" + when: + - system_roles | d("") | length > 0 \ No newline at end of file