Skip to content

Commit

Permalink
Merge branch 'no-default-tags'
Browse files Browse the repository at this point in the history
  • Loading branch information
paulczar committed Jan 22, 2024
2 parents 094a05e + fcf01bd commit cc0fe25
Show file tree
Hide file tree
Showing 74 changed files with 1,040 additions and 411 deletions.
31 changes: 20 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


CLUSTER_NAME ?= ans-$(shell whoami)
EXTRA_VARS ?= --extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)"

VIRTUALENV ?= "./virtualenv/"
ANSIBLE = $(VIRTUALENV)/bin/ansible-playbook -v $(EXTRA_VARS)
Expand Down Expand Up @@ -47,38 +46,48 @@ delete:
$(ANSIBLE) delete-cluster.yaml

create.multiaz:
$(ANSIBLE) create-cluster.yaml -i ./environment/multi-az/hosts
$(ANSIBLE) create-cluster.yaml -i ./environment/multi-az/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)"

create.private:
$(ANSIBLE) create-cluster.yaml -i ./environment/private-link/hosts
$(ANSIBLE) create-cluster.yaml -i ./environment/private-link/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)"

delete.private:
$(ANSIBLE) delete-cluster.yaml -i ./environment/private-link/hosts
$(ANSIBLE) delete-cluster.yaml -i ./environment/private-link/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)"

create.pl: create.private

delete.pl: delete.private


delete.multiaz:
$(ANSIBLE) delete-cluster.yaml -i ./environment/multi-az/hosts
$(ANSIBLE) delete-cluster.yaml -i ./environment/multi-az/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)"

create.tgw:
$(ANSIBLE) create-cluster.yaml -i ./environment/transit-gateway-egress/hosts
$(ANSIBLE) create-cluster.yaml -i ./environment/transit-gateway-egress/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)"

delete.tgw:
$(ANSIBLE) delete-cluster.yaml -i ./environment/transit-gateway-egress/hosts
$(ANSIBLE) delete-cluster.yaml -i ./environment/transit-gateway-egress/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)"

create.hcp:
$(ANSIBLE) create-cluster.yaml -i ./environment/hcp/hosts
$(ANSIBLE) create-cluster.yaml -i ./environment/hcp/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)-HCP-ROSA"

delete.hcp:
$(ANSIBLE) delete-cluster.yaml -i ./environment/hcp/hosts
$(ANSIBLE) delete-cluster.yaml -i ./environment/hcp/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)-HCP-ROSA"

create.new:
$(ANSIBLE) install.yml -i ./environment/hcp/hosts
$(ANSIBLE) install.yml -i ./environment/hcp/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)-HCP-ROSA"
delete.new:
$(ANSIBLE) uninstall.yml -i ./environment/hcp/hosts
$(ANSIBLE) uninstall.yml -i ./environment/hcp/hosts \
--extra-vars "cluster_name=$(CLUSTER_NAME) rosa_account_roles_prefix=$(CLUSTER_NAME)-HCP-ROSA"

docker.create: image
docker run --rm \
Expand Down
36 changes: 35 additions & 1 deletion install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# - vars/main.yaml

roles:
# - name: roles/_vars
- name: roles/_vars
- name: roles/network_math
# - name: roles/tgw_create
# when: rosa_tgw_enabled | bool
Expand All @@ -53,3 +53,37 @@
gateway_endpoints: [s3]
interface_endpoints: [sts,ec2,elasticloadbalancing]
when: rosa_subnet_ids | default([]) | length == 0

- name: roles/rosa_account_roles
vars:
rosa_account_roles:
hosted_cp: "{{ rosa_hosted_cp }}"
version: "{{ rosa_account_roles_version }}"
prefix: "{{ rosa_account_roles_prefix }}"

- name: roles/rosa_cluster
vars:
rosa_cluster:
name: "{{ cluster_name }}"
aws_account_id: "{{ aws_account_id }}"
account_roles_prefix: "{{ rosa_account_roles_prefix }}"
region: "{{ rosa_region }}"
private_link: "{{ rosa_private_link }}"
vpc_cidr: "{{ rosa_vpc_cidr }}"
multi_az: "{{ rosa_multi_az }}"
version: "{{ rosa_version }}"
hosted_cp: "{{ rosa_hosted_cp }}"
min_replicas: "{{ rosa_min_replicas }}"
max_replicas: "{{ rosa_max_replicas }}"
compute_nodes: "{{ rosa_compute_nodes | default(rosa_multi_az | ternary('3', '2')) }}"
compute_machine_type: "m5.xlarge"
kms_key_arn: "{{ rosa_kms_key_arn }}"
tags: "{{ extra_tags }}"
http_proxy: "{{ proxy_enabled | bool | ternary('http://'+(proxy_private_ip|default(''))+':3128', omit) }}"
https_proxy: "{{ proxy_enabled | bool | ternary('http://'+(proxy_private_ip|default(''))+':3128', omit) }}"
additional_trust_bundle_file: "{{ proxy_enabled | bool | ternary('roles/proxy_create/files/squid-ca-cert.pem', omit) }}" # "roles/proxy_create/files/squid-ca-cert.pem"
no_proxy: "{{ proxy_enabled | bool | ternary(rosa_no_proxy|default(None), omit) }}"




7 changes: 3 additions & 4 deletions roles/_vars/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ rosa_vpc_endpoints_enabled: false
rosa_subnet_ids: []
rosa_machine_cidr: ~
rosa_compute_machine_type: m5.xlarge

rosa_min_replicas:
rosa_max_replicas:
rosa_hosted_cp: False
rosa_account_roles_version: "4.14"
rosa_account_roles_prefix: AnsibleROSA
## leave commented out to use the cluster name as the prefix
# rosa_operator_roles_prefix: ~
rosa_account_roles_prefix: Ansible

rosa_custom_domain_enabled: false

Expand Down
8 changes: 8 additions & 0 deletions roles/_vars/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@

- set_fact:
aws_account_id: "{{ _aws_caller_info.account }}"

- fail:
msg: |
rosa_account_roles_prefix must end in "-HCP-ROSA" for Hosted Control Plane Clusters
rosa_account_roles_prefix currently set to: "{{ rosa_account_roles_prefix }}"
when:
- rosa_account_roles_prefix is not search("^.*-HCP-ROSA$")
- rosa_hosted_cp | bool

This file was deleted.

This file was deleted.

Loading

0 comments on commit cc0fe25

Please sign in to comment.