linting
This commit is contained in:
137
cloud/setup.yml
137
cloud/setup.yml
@@ -14,19 +14,6 @@ controller_execution_environments:
|
|||||||
- name: Cloud Services Execution Environment
|
- name: Cloud Services Execution Environment
|
||||||
image: quay.io/scottharwell/cloud-ee:latest
|
image: quay.io/scottharwell/cloud-ee:latest
|
||||||
|
|
||||||
controller_projects:
|
|
||||||
- name: Ansible Cloud Content Lab - AWS
|
|
||||||
organization: Default
|
|
||||||
scm_type: git
|
|
||||||
wait: yes
|
|
||||||
#scm_url: https://github.com/ansible-content-lab/aws.infrastructure_config_demos.git
|
|
||||||
scm_url: https://github.com/willtome/aws.infrastructure_config_demos.git
|
|
||||||
default_environment: Cloud Services Execution Environment
|
|
||||||
|
|
||||||
controller_execution_environments:
|
|
||||||
- name: Cloud Services Execution Environment
|
|
||||||
image: quay.io/scottharwell/cloud-ee:latest
|
|
||||||
|
|
||||||
controller_projects:
|
controller_projects:
|
||||||
- name: Ansible Cloud Content Lab - AWS
|
- name: Ansible Cloud Content Lab - AWS
|
||||||
organization: Default
|
organization: Default
|
||||||
@@ -99,22 +86,12 @@ controller_groups:
|
|||||||
variables:
|
variables:
|
||||||
ansible_user: ec2-user
|
ansible_user: ec2-user
|
||||||
|
|
||||||
controller_groups:
|
|
||||||
- name: cloud_aws
|
|
||||||
inventory: Workshop Inventory
|
|
||||||
variables:
|
|
||||||
ansible_user: ec2-user
|
|
||||||
|
|
||||||
controller_templates:
|
controller_templates:
|
||||||
- name: Cloud / AWS / Create Peer Infrastructure
|
- name: Cloud / AWS / Create Peer Infrastructure
|
||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
credentials:
|
credentials:
|
||||||
<<<<<<< HEAD
|
|
||||||
- AWS
|
- AWS
|
||||||
=======
|
|
||||||
- AWS
|
|
||||||
>>>>>>> main
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: playbook_create_peer_network.yml
|
playbook: playbook_create_peer_network.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
@@ -130,11 +107,7 @@ controller_templates:
|
|||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
credentials:
|
credentials:
|
||||||
<<<<<<< HEAD
|
|
||||||
- AWS
|
- AWS
|
||||||
=======
|
|
||||||
- AWS
|
|
||||||
>>>>>>> main
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: playbook_delete_peer_network.yml
|
playbook: playbook_delete_peer_network.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
@@ -148,11 +121,7 @@ controller_templates:
|
|||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
credentials:
|
credentials:
|
||||||
<<<<<<< HEAD
|
|
||||||
- AWS
|
- AWS
|
||||||
=======
|
|
||||||
- AWS
|
|
||||||
>>>>>>> main
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: playbook_create_transit_network.yml
|
playbook: playbook_create_transit_network.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
@@ -168,11 +137,7 @@ controller_templates:
|
|||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
credentials:
|
credentials:
|
||||||
<<<<<<< HEAD
|
|
||||||
- AWS
|
- AWS
|
||||||
=======
|
|
||||||
- AWS
|
|
||||||
>>>>>>> main
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: playbook_delete_transit_network.yml
|
playbook: playbook_delete_transit_network.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
@@ -182,20 +147,11 @@ controller_templates:
|
|||||||
extra_vars:
|
extra_vars:
|
||||||
aws_region: us-east-1
|
aws_region: us-east-1
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
- name: Cloud / Create Infra
|
|
||||||
job_type: run
|
|
||||||
organization: Default
|
|
||||||
credentials:
|
|
||||||
- AWS
|
|
||||||
# - Azure
|
|
||||||
=======
|
|
||||||
- name: Cloud / AWS / Create VPC
|
- name: Cloud / AWS / Create VPC
|
||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
credentials:
|
credentials:
|
||||||
- AWS
|
- AWS
|
||||||
>>>>>>> main
|
|
||||||
project: Ansible official demo project
|
project: Ansible official demo project
|
||||||
playbook: cloud/create_vpc.yml
|
playbook: cloud/create_vpc.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
@@ -213,29 +169,13 @@ controller_templates:
|
|||||||
type: text
|
type: text
|
||||||
variable: aws_owner_tag
|
variable: aws_owner_tag
|
||||||
required: true
|
required: true
|
||||||
<<<<<<< HEAD
|
|
||||||
choices:
|
|
||||||
- aws
|
|
||||||
# - azure
|
|
||||||
- question_name: AWS Public Key (only required for aws provider)
|
|
||||||
type: textarea
|
|
||||||
required: false
|
|
||||||
variable: aws_public_key
|
|
||||||
=======
|
|
||||||
>>>>>>> main
|
|
||||||
|
|
||||||
- name: Cloud / AWS / Create VM
|
- name: Cloud / AWS / Create VM
|
||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
<<<<<<< HEAD
|
|
||||||
credentials:
|
credentials:
|
||||||
- AWS
|
- AWS
|
||||||
- Workshop Credential
|
- Workshop Credential
|
||||||
=======
|
|
||||||
credentials:
|
|
||||||
- AWS
|
|
||||||
- Workshop Credential
|
|
||||||
>>>>>>> main
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: playbook_create_vm.yml
|
playbook: playbook_create_vm.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
@@ -285,33 +225,19 @@ controller_templates:
|
|||||||
type: text
|
type: text
|
||||||
variable: aws_vpc_subnet_name
|
variable: aws_vpc_subnet_name
|
||||||
required: true
|
required: true
|
||||||
<<<<<<< HEAD
|
|
||||||
default: dmz-subnet
|
|
||||||
=======
|
|
||||||
default: aws-test-subnet
|
default: aws-test-subnet
|
||||||
>>>>>>> main
|
|
||||||
- question_name: Security Group
|
- question_name: Security Group
|
||||||
type: text
|
type: text
|
||||||
variable: aws_securitygroup_name
|
variable: aws_securitygroup_name
|
||||||
required: true
|
required: true
|
||||||
<<<<<<< HEAD
|
|
||||||
default: dmz-sg
|
|
||||||
=======
|
|
||||||
default: aws-test-sg
|
default: aws-test-sg
|
||||||
>>>>>>> main
|
|
||||||
|
|
||||||
- name: Cloud / AWS / Delete VM
|
- name: Cloud / AWS / Delete VM
|
||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
<<<<<<< HEAD
|
|
||||||
credentials:
|
credentials:
|
||||||
- AWS
|
- AWS
|
||||||
- Workshop Credential
|
- Workshop Credential
|
||||||
=======
|
|
||||||
credentials:
|
|
||||||
- AWS
|
|
||||||
- Workshop Credential
|
|
||||||
>>>>>>> main
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: playbook_delete_inventory_vm.yml
|
playbook: playbook_delete_inventory_vm.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
@@ -328,18 +254,6 @@ controller_templates:
|
|||||||
- question_name: Name or Pattern
|
- question_name: Name or Pattern
|
||||||
type: text
|
type: text
|
||||||
variable: _hosts
|
variable: _hosts
|
||||||
<<<<<<< HEAD
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- name: Cloud / AWS / VPC Report
|
|
||||||
job_type: run
|
|
||||||
organization: Default
|
|
||||||
credentials:
|
|
||||||
- AWS
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
|
||||||
playbook: playbook_create_reports.yml
|
|
||||||
inventory: Workshop Inventory
|
|
||||||
=======
|
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- name: Cloud / AWS / VPC Report
|
- name: Cloud / AWS / VPC Report
|
||||||
@@ -408,59 +322,16 @@ controller_workflows:
|
|||||||
- name: Deploy Cloud Stack in AWS
|
- name: Deploy Cloud Stack in AWS
|
||||||
description: A workflow to deploy a cloud stack
|
description: A workflow to deploy a cloud stack
|
||||||
organization: Default
|
organization: Default
|
||||||
>>>>>>> main
|
|
||||||
notification_templates_started: Telemetry
|
notification_templates_started: Telemetry
|
||||||
notification_templates_success: Telemetry
|
notification_templates_success: Telemetry
|
||||||
notification_templates_error: Telemetry
|
notification_templates_error: Telemetry
|
||||||
extra_vars:
|
extra_vars:
|
||||||
<<<<<<< HEAD
|
|
||||||
aws_region: us-east-1
|
|
||||||
aws_report: vpc
|
|
||||||
|
|
||||||
- name: Cloud / AWS / Tags Report
|
|
||||||
job_type: run
|
|
||||||
organization: Default
|
|
||||||
credentials:
|
|
||||||
- AWS
|
|
||||||
project: Ansible Cloud Content Lab - AWS
|
|
||||||
playbook: playbook_create_reports.yml
|
|
||||||
inventory: Workshop Inventory
|
|
||||||
notification_templates_started: Telemetry
|
|
||||||
notification_templates_success: Telemetry
|
|
||||||
notification_templates_error: Telemetry
|
|
||||||
extra_vars:
|
|
||||||
aws_region: us-east-1
|
|
||||||
aws_report: tags
|
|
||||||
|
|
||||||
- name: Cloud / AWS / Create Keypair
|
|
||||||
job_type: run
|
|
||||||
organization: Default
|
|
||||||
credentials:
|
|
||||||
- AWS
|
|
||||||
project: Ansible official demo project
|
|
||||||
playbook: cloud/aws_key.yml
|
|
||||||
inventory: Workshop Inventory
|
|
||||||
notification_templates_started: Telemetry
|
|
||||||
notification_templates_success: Telemetry
|
|
||||||
notification_templates_error: Telemetry
|
|
||||||
survey_enabled: true
|
|
||||||
extra_vars:
|
|
||||||
aws_region: us-east-1
|
|
||||||
=======
|
|
||||||
vm_deployment: cloud_stack
|
vm_deployment: cloud_stack
|
||||||
survey_enabled: true
|
survey_enabled: true
|
||||||
>>>>>>> main
|
|
||||||
survey:
|
survey:
|
||||||
name: ''
|
name: ''
|
||||||
description: ''
|
description: ''
|
||||||
spec:
|
spec:
|
||||||
<<<<<<< HEAD
|
|
||||||
- question_name: Keypair Name
|
|
||||||
type: text
|
|
||||||
variable: aws_key_name
|
|
||||||
required: true
|
|
||||||
default: aws-test-key
|
|
||||||
=======
|
|
||||||
- question_name: Owner
|
- question_name: Owner
|
||||||
type: text
|
type: text
|
||||||
variable: aws_owner_tag
|
variable: aws_owner_tag
|
||||||
@@ -473,17 +344,10 @@ controller_workflows:
|
|||||||
- Dev
|
- Dev
|
||||||
- QA
|
- QA
|
||||||
- Prod
|
- Prod
|
||||||
>>>>>>> main
|
|
||||||
- question_name: Keypair Public Key
|
- question_name: Keypair Public Key
|
||||||
type: textarea
|
type: textarea
|
||||||
variable: aws_public_key
|
variable: aws_public_key
|
||||||
required: true
|
required: true
|
||||||
<<<<<<< HEAD
|
|
||||||
- question_name: Owner
|
|
||||||
type: text
|
|
||||||
variable: aws_keypair_owner
|
|
||||||
required: true
|
|
||||||
=======
|
|
||||||
- question_name: Email
|
- question_name: Email
|
||||||
type: text
|
type: text
|
||||||
variable: email
|
variable: email
|
||||||
@@ -558,4 +422,3 @@ controller_workflows:
|
|||||||
feedback: Failed to create AWS instance
|
feedback: Failed to create AWS instance
|
||||||
- identifier: Tag Report
|
- identifier: Tag Report
|
||||||
unified_job_template: Cloud / AWS / Tags Report
|
unified_job_template: Cloud / AWS / Tags Report
|
||||||
>>>>>>> main
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
galaxy_info:
|
|
||||||
author: morenod
|
|
||||||
description: Role created to configure a client to execute openscap policies based on the information obtained from a Red Hat Satellite/Foreman Host.
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Install openscap client packages
|
- name: Install openscap client packages
|
||||||
<<<<<<< HEAD
|
|
||||||
ansible.builtin.yum:
|
ansible.builtin.yum:
|
||||||
name:
|
name:
|
||||||
- openscap-scanner
|
- openscap-scanner
|
||||||
@@ -38,51 +37,11 @@
|
|||||||
force_basic_auth: false
|
force_basic_auth: false
|
||||||
body_format: json
|
body_format: json
|
||||||
validate_certs: false
|
validate_certs: false
|
||||||
=======
|
|
||||||
yum:
|
|
||||||
name:
|
|
||||||
- openscap-scanner
|
|
||||||
- rubygem-foreman_scap_client
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Get Policy parameters
|
|
||||||
uri:
|
|
||||||
url: "{{ foreman_server_url }}/api/v2/compliance/policies"
|
|
||||||
method: GET
|
|
||||||
user: "{{ foreman_username }}"
|
|
||||||
password: "{{ foreman_password }}"
|
|
||||||
force_basic_auth: yes
|
|
||||||
body_format: json
|
|
||||||
validate_certs: False
|
|
||||||
register: policies
|
|
||||||
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
|
|
||||||
|
|
||||||
- name: Build policy {{ policy_name }} parameters
|
|
||||||
set_fact:
|
|
||||||
policy: "{{ policy | default([]) }} + {{ [item] }}"
|
|
||||||
loop: "{{policies.json.results}}"
|
|
||||||
when: item.name in policy_name or policy_name == 'all'
|
|
||||||
|
|
||||||
- name: Fail if no policy found with required name
|
|
||||||
fail:
|
|
||||||
when: policy is not defined
|
|
||||||
|
|
||||||
- name: Get scap content information
|
|
||||||
uri:
|
|
||||||
url: "{{ foreman_server_url }}/api/v2/compliance/scap_contents/{{item.scap_content_id}}"
|
|
||||||
method: GET
|
|
||||||
user: "{{ foreman_username }}"
|
|
||||||
password: "{{ foreman_password }}"
|
|
||||||
force_basic_auth: yes
|
|
||||||
body_format: json
|
|
||||||
validate_certs: False
|
|
||||||
>>>>>>> main
|
|
||||||
register: scapcontents
|
register: scapcontents
|
||||||
loop: "{{ policy }}"
|
loop: "{{ policy }}"
|
||||||
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
|
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
|
||||||
|
|
||||||
- name: Get tailoring content information
|
- name: Get tailoring content information
|
||||||
<<<<<<< HEAD
|
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "{{ foreman_server_url }}/api/v2/compliance/tailoring_files/{{ item.tailoring_file_id }}"
|
url: "{{ foreman_server_url }}/api/v2/compliance/tailoring_files/{{ item.tailoring_file_id }}"
|
||||||
method: GET
|
method: GET
|
||||||
@@ -91,23 +50,12 @@
|
|||||||
force_basic_auth: false
|
force_basic_auth: false
|
||||||
body_format: json
|
body_format: json
|
||||||
validate_certs: false
|
validate_certs: false
|
||||||
=======
|
|
||||||
uri:
|
|
||||||
url: "{{ foreman_server_url }}/api/v2/compliance/tailoring_files/{{item.tailoring_file_id}}"
|
|
||||||
method: GET
|
|
||||||
user: "{{ foreman_username }}"
|
|
||||||
password: "{{ foreman_password }}"
|
|
||||||
force_basic_auth: yes
|
|
||||||
body_format: json
|
|
||||||
validate_certs: False
|
|
||||||
>>>>>>> main
|
|
||||||
register: tailoringfiles
|
register: tailoringfiles
|
||||||
when: item.tailoring_file_id | int > 0 | d(False)
|
when: item.tailoring_file_id | int > 0 | d(False)
|
||||||
loop: "{{ policy }}"
|
loop: "{{ policy }}"
|
||||||
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
|
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
|
||||||
|
|
||||||
- name: Build scap content parameters
|
- name: Build scap content parameters
|
||||||
<<<<<<< HEAD
|
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
scap_content: "{{ scap_content | default({}) | combine({item.json.id: item.json}) }}"
|
scap_content: "{{ scap_content | default({}) | combine({item.json.id: item.json}) }}"
|
||||||
loop: "{{ scapcontents.results }}"
|
loop: "{{ scapcontents.results }}"
|
||||||
@@ -115,20 +63,10 @@
|
|||||||
- name: Build tailoring content parameters
|
- name: Build tailoring content parameters
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
tailoring_files: "{{ tailoring_files | default({}) | combine({item.json.id: item.json}) }}"
|
tailoring_files: "{{ tailoring_files | default({}) | combine({item.json.id: item.json}) }}"
|
||||||
=======
|
|
||||||
set_fact:
|
|
||||||
scap_content: "{{ scap_content | default({}) | combine({item.json.id: item.json }) }}"
|
|
||||||
loop: "{{ scapcontents.results }}"
|
|
||||||
|
|
||||||
- name: Build tailoring content parameters
|
|
||||||
set_fact:
|
|
||||||
tailoring_files: "{{ tailoring_files | default({}) | combine({item.json.id: item.json }) }}"
|
|
||||||
>>>>>>> main
|
|
||||||
when: item.json is defined
|
when: item.json is defined
|
||||||
loop: "{{ tailoringfiles.results }}"
|
loop: "{{ tailoringfiles.results }}"
|
||||||
|
|
||||||
- name: Apply openscap client configuration template
|
- name: Apply openscap client configuration template
|
||||||
<<<<<<< HEAD
|
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: openscap_client_config.yaml.j2
|
src: openscap_client_config.yaml.j2
|
||||||
dest: /etc/foreman_scap_client/config.yaml
|
dest: /etc/foreman_scap_client/config.yaml
|
||||||
@@ -145,21 +83,3 @@
|
|||||||
# hour: "{{crontab_hour}}"
|
# hour: "{{crontab_hour}}"
|
||||||
# minute: "{{crontab_minute}}"
|
# minute: "{{crontab_minute}}"
|
||||||
# user: root
|
# user: root
|
||||||
=======
|
|
||||||
template:
|
|
||||||
src: openscap_client_config.yaml.j2
|
|
||||||
dest: /etc/foreman_scap_client/config.yaml
|
|
||||||
mode: 0644
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
|
|
||||||
#- name: Configure execution crontab
|
|
||||||
# cron:
|
|
||||||
# name: "Openscap Execution"
|
|
||||||
# cron_file: 'foreman_openscap_client'
|
|
||||||
# job: '/usr/bin/foreman_scap_client {{policy.id}} > /dev/null'
|
|
||||||
# weekday: "{{crontab_weekdays}}"
|
|
||||||
# hour: "{{crontab_hour}}"
|
|
||||||
# minute: "{{crontab_minute}}"
|
|
||||||
# user: root
|
|
||||||
>>>>>>> main
|
|
||||||
|
|||||||
@@ -193,7 +193,6 @@ controller_templates:
|
|||||||
credentials:
|
credentials:
|
||||||
- Satellite Credential
|
- Satellite Credential
|
||||||
|
|
||||||
|
|
||||||
controller_launch_jobs:
|
controller_launch_jobs:
|
||||||
- name: SETUP
|
- name: SETUP
|
||||||
wait: false
|
wait: false
|
||||||
@@ -262,8 +261,6 @@ controller_workflows:
|
|||||||
extra_data:
|
extra_data:
|
||||||
feedback: Failed to apply updates to RHEL8_Dev
|
feedback: Failed to apply updates to RHEL8_Dev
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
### Satellite Vars ###
|
### Satellite Vars ###
|
||||||
######################
|
######################
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Setting host facts using complex arguments
|
- name: Setting host facts using complex arguments
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
temp_password: "{{ lookup('community.general.random_string', min_lower=1, min_upper=1, min_special=1, min_numeric=1) }}"
|
temp_password: "{{ lookup('community.general.random_string', min_lower=1, min_upper=1, min_special=1, min_numeric=1) }}"
|
||||||
# Example result: ['&Qw2|E[-']
|
# Example result: ['&Qw2|E[-']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user