From e7d2da6f7d35dbdbc915ccf2e8b6c837482be8c3 Mon Sep 17 00:00:00 2001 From: Mitesh The Mouse <44154255+miteshrh@users.noreply.github.com> Date: Sat, 18 Jan 2020 06:28:31 +0100 Subject: [PATCH] update config:satellite-vm (#1015) --- ansible/configs/satellite-vm/files/hosts_template.j2 | 4 ansible/configs/satellite-vm/default_vars_ec2.yml | 71 --------- ansible/configs/satellite-vm/default_vars_osp.yml | 100 ++++++++++++++ ansible/configs/satellite-vm/sample_vars_ec2.yml | 54 +++++++ ansible/configs/satellite-vm/software.yml | 6 ansible/configs/satellite-vm/default_vars.yml | 61 ++++++++ ansible/configs/satellite-vm/sample_vars_osp.yml | 124 +++++++++++++++++ 7 files changed, 348 insertions(+), 72 deletions(-) diff --git a/ansible/configs/satellite-vm/default_vars.yml b/ansible/configs/satellite-vm/default_vars.yml new file mode 100644 index 0000000..241e7bb --- /dev/null +++ b/ansible/configs/satellite-vm/default_vars.yml @@ -0,0 +1,61 @@ +--- + +env_type: satellite-vm +output_dir: /tmp/workdir # Writable working scratch directory +email: "{{env_type}}@example.com" +guid: defaultguid + +# for file based repo +repo_method: file +use_own_repos: true +repo_version: "6.4" +## For RHN login +# repo_method: rhn +# rhsm_pool_ids: +# - 8a85f99b6b498682016b521dfe463949 +# rhel_subscription_user: +# rhel_subscription_pass: +###### + +deploy_local_ssh_config_location: "{{output_dir}}/" +key_name: ocpkey # Keyname must exist in AWS +use_own_key: true +env_authorized_key: "{{guid}}key" +set_env_authorized_key: true +default_key_name: ~/.ssh/{{key_name}}.pem + +install_bastion: true +install_common: true +install_ipa_client: false +tower_run: false +update_packages: false +update_all_packages: false +install_satellite: True +configure_satellite: false + +project_tag: "{{ env_type }}-{{ guid }}" + +rhel_repos: + - rhel-7-server-rpms + - rhel-server-rhscl-7-rpms + - rhel-7-server-satellite-6.4-rpms + - rhel-7-server-satellite-maintenance-6-rpms + - rhel-7-server-ansible-2.6-rpms + - rhel-7-server-extras-rpms + +common_packages: + - python + - unzip + - bash-completion + - tmux + - wget + - git + - vim-enhanced + - at + - python27-python-pip + - bind-utils + +cf_template_description: "{{ env_type }}-{{ guid }} Ansible Agnostic Deployer " + + +... \ No newline at end of file diff --git a/ansible/configs/satellite-vm/env_vars.yml b/ansible/configs/satellite-vm/default_vars_ec2.yml similarity index 63% rename from ansible/configs/satellite-vm/env_vars.yml rename to ansible/configs/satellite-vm/default_vars_ec2.yml index 9c48fd7..cf94603 100644 --- a/ansible/configs/satellite-vm/env_vars.yml +++ b/ansible/configs/satellite-vm/default_vars_ec2.yml @@ -1,18 +1,15 @@ ################################################################################ -################################################################################ -### Environment Structure -################################################################################ +### Environment Settings for aws ################################################################################ ## Environment Sizing +cloud_provider: ec2 # Which AgnosticD Cloud Provider to use # User info for notifications +HostedZoneId: Z3IHLWJZOU9SRT +aws_region: ap-southeast-2 -default_key_name: ~/.ssh/{{key_name}}.pem -tower_run: false # How many do you want for each instance type - - -bastion_instance_type: "t2.medium" +bastion_instance_type: "t3.medium" bastion_instance_image: RHEL75 satellite_instance_count: 1 @@ -90,7 +87,6 @@ - key: "instance_filter" value: "{{ env_type }}-{{ email }}" - # DNS settings for environmnet subdomain_base_short: "{{ guid }}" subdomain_base_suffix: ".example.opentlc.com" @@ -99,60 +95,3 @@ zone_internal_dns: "{{guid}}.internal." chomped_zone_internal_dns: "{{guid}}.internal" -# Stuff that only GPTE cares about: -install_ipa_client: false - -# for file based repo -repo_method: file -use_own_repos: true -repo_version: "6.4" - -## For RHN login -# repo_method: rhn -# rhsm_pool_ids: -# - 8a85f99b6b498682016b521dfe463949 -# rhel_subscription_user: -# rhel_subscription_pass: - -###### -rhel_repos: - - rhel-7-server-rpms - - rhel-server-rhscl-7-rpms - - rhel-7-server-satellite-6.4-rpms - - rhel-7-server-satellite-maintenance-6-rpms - - rhel-7-server-ansible-2.6-rpms - - rhel-7-server-extras-rpms - -# Do you want to run a full yum update -update_packages: false - -common_packages: - - python - - unzip - - bash-completion - - tmux - - wget - - git - - vim-enhanced - - at - - python27-python-pip - - bind-utils - - -guid: defaultguid -install_bastion: true -install_common: true -install_ipa_client: false - - -deploy_local_ssh_config_location: "{{output_dir}}/" -use_own_key: true -env_authorized_key: "{{guid}}key" -set_env_authorized_key: true - - -HostedZoneId: Z3IHLWJZOU9SRT -project_tag: "{{ env_type }}-{{ guid }}" -cloud_provider: ec2 # Which AgnosticD Cloud Provider to use -key_name: ocpkey # Keyname must exist in AWS -aws_region: ap-southeast-2 diff --git a/ansible/configs/satellite-vm/default_vars_osp.yml b/ansible/configs/satellite-vm/default_vars_osp.yml new file mode 100644 index 0000000..f087972 --- /dev/null +++ b/ansible/configs/satellite-vm/default_vars_osp.yml @@ -0,0 +1,100 @@ +################################################################################ +### OSP Environment variables +################################################################################ + + +cloud_provider: osp +install_student_user: false + + +ansible_user: cloud-user +remote_user: cloud-user +osp_cluster_dns_zone: red.osp.opentlc.com +osp_cluster_dns_server: ddns01.opentlc.com +use_dynamic_dns: true +osp_project_create: true +student_name: student +admin_user: opentlc-mgr + + +bastion_instance_type: 2c2g30d +satellite_instance_type: 8c32g100d + +_image: rhel-server-7.7-update-2 +bastion_instance_image: "{{ _image }}" +satellite_instance_image: "{{ _image }}" + +satellite_instance_count: 1 + +security_groups: + - name: SatelliteSG + rules: + - name: SatHTTPSPorts + description: "HTTPS Public" + from_port: 443 + to_port: 443 + protocol: tcp + cidr: "0.0.0.0/0" + rule_type: Ingress + - name: BastionUDPPorts + description: "Only from bastion" + from_port: 1 + to_port: 65535 + protocol: udp + from_group: DefaultSG + rule_type: Ingress + - name: BastionTCPPorts + description: "Only from bastion" + from_port: 1 + to_port: 65535 + protocol: tcp + from_group: DefaultSG + rule_type: Ingress + +# Environment Instances +instances: + - name: "bastion" + count: 1 + unique: true + public_dns: true + dns_loadbalancer: false + floating_ip: true + image_id: "{{ bastion_instance_image }}" + flavor: + ec2: "{{bastion_instance_type}}" + osp: "{{bastion_instance_type}}" + azure: Standard_A2_V2 + security_groups: + - BastionSG + - DefaultSG + tags: + - key: "AnsibleGroup" + value: "bastions" + - key: "ostype" + value: "linux" + - key: "instance_filter" + value: "{{ env_type }}-{{ email }}" + + - name: "satellite" + count: "{{satellite_instance_count}}" + public_dns: true + floating_ip: true + image_id: "{{ satellite_instance_image }}" + flavor: + ec2: "{{satellite_instance_type}}" + osp: "{{satellite_instance_type}}" + azure: Standard_A2_V2 + image_id: "{{ satellite_instance_image }}" + security_groups: + - SatelliteSG + - DefaultSG + tags: + - key: "AnsibleGroup" + value: "satellites" + - key: "ostype" + value: "linux" + - key: "instance_filter" + value: "{{ env_type }}-{{ email }}" + + + diff --git a/ansible/configs/satellite-vm/files/hosts_template.j2 b/ansible/configs/satellite-vm/files/hosts_template.j2 index c315c3f..400fe34 100644 --- a/ansible/configs/satellite-vm/files/hosts_template.j2 +++ b/ansible/configs/satellite-vm/files/hosts_template.j2 @@ -2,7 +2,11 @@ [satellites] {% for host in groups['satellites'] %} +{% if cloud_provider == 'ec2' %} {{host}} +{% elif cloud_provider == 'osp' %} +{{host}} ansible_host={{host}}.example.com +{% endif %} {% endfor %} diff --git a/ansible/configs/satellite-vm/sample_vars.yml b/ansible/configs/satellite-vm/sample_vars_ec2.yml similarity index 61% rename from ansible/configs/satellite-vm/sample_vars.yml rename to ansible/configs/satellite-vm/sample_vars_ec2.yml index c2fb4c2..b4efd78 100644 --- a/ansible/configs/satellite-vm/sample_vars.yml +++ b/ansible/configs/satellite-vm/sample_vars_ec2.yml @@ -1,10 +1,12 @@ --- -env_type: satellite-vm # Name of config to deploy +env_type: satellite-vm output_dir: /tmp/workdir # Writable working scratch directory -email: satellite_vm@example.com -cloud_provider: ec2 # Which AgnosticD Cloud Provider to use # User info for notifications +email: satellite_vm@example.com +guid: satvm01 +cloud_provider: ec2 aws_region: ap-southeast-2 +configure_satellite: True ###### satellite env related variables ############### install_satellite: True @@ -96,3 +98,49 @@ releasever: '7Server' ... + +# ## repositories which can be used +# - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server' +# product: 'Red Hat Software Collections for RHEL Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7.7' + +# - name: 'Red Hat Enterprise Linux 7 Server - RH Common (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Enterprise Linux 7 Server - Extras (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' + +# - name: 'Red Hat Enterprise Linux 7 Server - Optional (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' +# - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Satellite Capsule 6.4 (for RHEL 7 Server) (RPMs)' +# product: 'Red Hat Satellite Capsule' +# basearch: 'x86_64' + +# - name: 'Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' + +# - name: 'Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server' +# product: 'Red Hat Ansible Engine' +# basearch: 'x86_64' \ No newline at end of file diff --git a/ansible/configs/satellite-vm/sample_vars_osp.yml b/ansible/configs/satellite-vm/sample_vars_osp.yml new file mode 100644 index 0000000..53733db --- /dev/null +++ b/ansible/configs/satellite-vm/sample_vars_osp.yml @@ -0,0 +1,124 @@ +--- + +env_type: satellite-vm +output_dir: /tmp/workdir # Writable working scratch directory +email: satellite_vm@example.com +cloud_provider: osp +guid: satvm01 +osp_cluster_dns_zone: red.osp.opentlc.com +configure_satellite: True + +###### satellite env related variables ############### +satellite_version: 6.4 +org: gpte +org_label: gpte +org_description: "Global Partner Training and Enablement" +lifecycle_environment_path: + - name: "Dev" + label: "dev" + description: "Development Environment" + prior_env: "Library" + - name: "QA" + label: "qa" + description: "Quality Environment" + prior_env: "Dev" + - name: "Prod" + label: "prod" + description: "Production Enviornment" + prior_env: "QA" + +subscription_name: "Employee SKU" +########## Activation Key ##################### +satellite_content: + - name: "Capsule Server" + activation_key: "capsule_key" + subscriptions: + - "Employee SKU" + life_cycle: "Library" + content_view: "Capsule Content" + content_view_update: False + repos: + - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' + product: 'Red Hat Enterprise Linux Server' + basearch: 'x86_64' + releasever: '7Server' + + - name: 'Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server' + product: 'Red Hat Software Collections for RHEL Server' + basearch: 'x86_64' + releasever: '7Server' + + - name: 'Red Hat Satellite Capsule 6.4 (for RHEL 7 Server) (RPMs)' + product: 'Red Hat Satellite Capsule' + basearch: 'x86_64' + + - name: 'Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)' + product: 'Red Hat Enterprise Linux Server' + basearch: 'x86_64' + + - name: 'Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server' + product: 'Red Hat Ansible Engine' + basearch: 'x86_64' + - name: "Three Tier App" + activation_key: "three_tier_app_key" + content_view: "Three Tier App Content" + life_cycle: "Library" + subscriptions: + - "Employee SKU" + repos: + - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' + product: 'Red Hat Enterprise Linux Server' + basearch: 'x86_64' + releasever: '7Server' + + - name: 'Red Hat Enterprise Linux 7 Server - Extras (RPMs)' + product: 'Red Hat Enterprise Linux Server' + basearch: 'x86_64' + +... + +# ## repositories which can be used +# - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server' +# product: 'Red Hat Software Collections for RHEL Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7.7' + +# - name: 'Red Hat Enterprise Linux 7 Server - RH Common (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Enterprise Linux 7 Server - Extras (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' + +# - name: 'Red Hat Enterprise Linux 7 Server - Optional (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' +# - name: 'Red Hat Enterprise Linux 7 Server (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' +# releasever: '7Server' + +# - name: 'Red Hat Satellite Capsule 6.4 (for RHEL 7 Server) (RPMs)' +# product: 'Red Hat Satellite Capsule' +# basearch: 'x86_64' + +# - name: 'Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)' +# product: 'Red Hat Enterprise Linux Server' +# basearch: 'x86_64' + +# - name: 'Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server' +# product: 'Red Hat Ansible Engine' +# basearch: 'x86_64' \ No newline at end of file diff --git a/ansible/configs/satellite-vm/software.yml b/ansible/configs/satellite-vm/software.yml index 755135d..c0b2240 100644 --- a/ansible/configs/satellite-vm/software.yml +++ b/ansible/configs/satellite-vm/software.yml @@ -20,9 +20,9 @@ - { role: "satellite-manage-manifest", when: configure_satellite } - { role: "satellite-manage-subscription", when: configure_satellite } - { role: "satellite-manage-sync", when: configure_satellite } - - { role: "satellite-manage-lifecycle", when: configure_satellite } - - { role: "satellite-manage-content-view", when: configure_satellite } - - { role: "satellite-manage-activationkey", when: configure_satellite } + # - { role: "satellite-manage-lifecycle", when: configure_satellite } + # - { role: "satellite-manage-content-view", when: configure_satellite } + # - { role: "satellite-manage-activationkey", when: configure_satellite } - name: Software flight-check -- Gitblit v1.9.3