From b95170503613bb97c00175324b31ed91f6f41ea1 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Thu, 2 Nov 2017 11:03:39 +0100 Subject: Namespace the OpenStack vars This makes sure that all the variables used in the `openshift_openstack` role are prefixed with `openshift_openstack_` as is the convention. --- playbooks/openstack/README.md | 12 +-- playbooks/openstack/advanced-configuration.md | 80 ++++++++-------- .../openstack/openshift-cluster/provision.yml | 4 +- .../sample-inventory/group_vars/OSEv3.yml | 10 +- .../openstack/sample-inventory/group_vars/all.yml | 102 ++++++++++----------- 5 files changed, 104 insertions(+), 104 deletions(-) (limited to 'playbooks/openstack') diff --git a/playbooks/openstack/README.md b/playbooks/openstack/README.md index 99f4ab12f..f3fe13530 100644 --- a/playbooks/openstack/README.md +++ b/playbooks/openstack/README.md @@ -142,27 +142,27 @@ corresponding to your OpenStack installation. $ vi inventory/group_vars/all.yml ``` -1. Set the `openstack_keypair_name` to your OpenStack keypair name. +1. Set the `openshift_openstack_keypair_name` to your OpenStack keypair name. - See `openstack keypair list` to find the keypairs registered with OpenShift. - This must correspond to your private SSH key in `~/.ssh/id_rsa` -2. Set the `openstack_external_network_name` to the floating IP +2. Set the `openshift_openstack_external_network_name` to the floating IP network of your openstack. - See `openstack network list` for the list of networks. - It's often called `public`, `external` or `ext-net`. -3. Set the `openstack_default_image_name` to the image you want your +3. Set the `openshift_openstack_default_image_name` to the image you want your OpenShift VMs to run. - See `openstack image list` for the list of available images. -4. Set the `openstack_default_flavor` to the flavor you want your +4. Set the `openshift_openstack_default_flavor` to the flavor you want your OpenShift VMs to use. - See `openstack flavor list` for the list of available flavors. -5. Set the `openstack_dns_nameservers` to the list of the IP addresses +5. Set the `openshift_openstack_dns_nameservers` to the list of the IP addresses of the DNS servers used for the **private** address resolution. **NOTE ON DNS**: at minimum, the OpenShift nodes need to be able to access each other by their hostname. OpenStack doesn't provide this by default, so you need to provide a DNS server. Put the address of that DNS server in -`openstack_dns_nameservers` variable. +`openshift_openstack_dns_nameservers` variable. diff --git a/playbooks/openstack/advanced-configuration.md b/playbooks/openstack/advanced-configuration.md index 5ffec708a..90cc20b98 100644 --- a/playbooks/openstack/advanced-configuration.md +++ b/playbooks/openstack/advanced-configuration.md @@ -182,17 +182,17 @@ So the provisioned cluster nodes will start using those natively as default nameservers. Technically, this allows to deploy OpenShift clusters without dnsmasq proxies. -The `env_id` and `public_dns_domain` will form the cluster's DNS domain all +The `openshift_openstack_clusterid` and `openshift_openstack_public_dns_domain` will form the cluster's DNS domain all your servers will be under. With the default values, this will be `openshift.example.com`. For workloads, the default subdomain is 'apps'. -That sudomain can be set as well by the `openshift_app_domain` variable in +That sudomain can be set as well by the `openshift_openstack_app_subdomain` variable in the inventory. The `openstack__hostname` is a set of variables used for customising hostnames of servers with a given role. When such a variable stays commented, default hostname (usually the role name) is used. -The `openstack_dns_nameservers` is a list of DNS servers accessible from all +The `openshift_openstack_dns_nameservers` is a list of DNS servers accessible from all the created Nova servers. These will provide the internal name resolution for your OpenShift nodes (as well as upstream name resolution for installing packages, etc.). @@ -204,10 +204,10 @@ daemon that in turn proxies DNS requests to the authoritative DNS server. When Network Manager is enabled for provisioned cluster nodes, which is normally the case, you should not change the defaults and always deploy dnsmasq. -`external_nsupdate_keys` describes an external authoritative DNS server(s) +`openshift_openstack_external_nsupdate_keys` describes an external authoritative DNS server(s) processing dynamic records updates in the public and private cluster views: - external_nsupdate_keys: + openshift_openstack_external_nsupdate_keys: public: key_secret: key_algorithm: 'hmac-md5' @@ -227,7 +227,7 @@ another external DNS server. Another example defines an external DNS server for the public view additionally to the in-stack DNS server used for the private view only: - external_nsupdate_keys: + openshift_openstack_external_nsupdate_keys: public: key_secret: key_algorithm: 'hmac-sha256' @@ -264,51 +264,51 @@ step for flannel and docker iptables configuration: ## Other configuration variables -`openstack_keypair_name` is a Nova keypair - you can see your +`openshift_openstack_keypair_name` is a Nova keypair - you can see your keypairs with `openstack keypair list`. It must correspond to the private SSH key Ansible will use to log into the created VMs. This is `~/.ssh/id_rsa` by default, but you can use a different key by passing `--private-key` to `ansible-playbook`. -`openstack_default_image_name` is the default name of the Glance image the +`openshift_openstack_default_image_name` is the default name of the Glance image the servers will use. You can see your images with `openstack image list`. In order to set a different image for a role, uncomment the line with the -corresponding variable (e.g. `openstack_lb_image_name` for load balancer) and -set its value to another available image name. `openstack_default_image_name` +corresponding variable (e.g. `openshift_openstack_lb_image_name` for load balancer) and +set its value to another available image name. `openshift_openstack_default_image_name` must stay defined as it is used as a default value for the rest of the roles. -`openstack_default_flavor` is the default Nova flavor the servers will use. +`openshift_openstack_default_flavor` is the default Nova flavor the servers will use. You can see your flavors with `openstack flavor list`. In order to set a different flavor for a role, uncomment the line with the -corresponding variable (e.g. `openstack_lb_flavor` for load balancer) and -set its value to another available flavor. `openstack_default_flavor` must +corresponding variable (e.g. `openshift_openstack_lb_flavor` for load balancer) and +set its value to another available flavor. `openshift_openstack_default_flavor` must stay defined as it is used as a default value for the rest of the roles. -`openstack_external_network_name` is the name of the Neutron network +`openshift_openstack_external_network_name` is the name of the Neutron network providing external connectivity. It is often called `public`, `external` or `ext-net`. You can see your networks with `openstack network list`. -`openstack_private_network_name` is the name of the private Neutron network +`openshift_openstack_private_network_name` is the name of the private Neutron network providing admin/control access for ansible. It can be merged with other cluster networks, there are no special requirements for networking. -The `openstack_num_masters`, `openstack_num_infra` and -`openstack_num_nodes` values specify the number of Master, Infra and +The `openshift_openstack_num_masters`, `openshift_openstack_num_infra` and +`openshift_openstack_num_nodes` values specify the number of Master, Infra and App nodes to create. -The `openshift_cluster_node_labels` defines custom labels for your openshift +The `openshift_openstack_cluster_node_labels` defines custom labels for your openshift cluster node groups. It currently supports app and infra node groups. The default value of this variable sets `region: primary` to app nodes and `region: infra` to infra nodes. An example of setting a customised label: ``` -openshift_cluster_node_labels: +openshift_openstack_cluster_node_labels: app: mylabel: myvalue ``` -The `openstack_nodes_to_remove` allows you to specify the numerical indexes +The `openshift_openstack_nodes_to_remove` allows you to specify the numerical indexes of App nodes that should be removed; for example, ['0', '2'], The `docker_volume_size` is the default Docker volume size the servers will use. @@ -318,15 +318,15 @@ for master) and change its value. `docker_volume_size` must stay defined as it i used as a default value for some of the servers (master, infra, app node). The rest of the roles (etcd, load balancer, dns) have their defaults hard-coded. -**Note**: If the `ephemeral_volumes` is set to `true`, the `*_volume_size` variables +**Note**: If the `openshift_openstack_ephemeral_volumes` is set to `true`, the `*_volume_size` variables will be ignored and the deployment will not create any cinder volumes. -The `openstack_flat_secgrp`, controls Neutron security groups creation for Heat +The `openshift_openstack_flat_secgrp`, controls Neutron security groups creation for Heat stacks. Set it to true, if you experience issues with sec group rules quotas. It trades security for number of rules, by sharing the same set of firewall rules for master, node, etcd and infra nodes. -The `required_packages` variable also provides a list of the additional +The `openshift_openstack_required_packages` variable also provides a list of the additional prerequisite packages to be installed before to deploy an OpenShift cluster. Those are ignored though, if the `manage_packages: False`. @@ -358,11 +358,11 @@ floating IP addresses to each node. If you have a provider network set up, this is all unnecessary as you can just access servers that are placed in the provider network directly. -To use a provider network, set its name in `openstack_provider_network_name` in +To use a provider network, set its name in `openshift_openstack_provider_network_name` in `inventory/group_vars/all.yml`. -If you set the provider network name, the `openstack_external_network_name` and -`openstack_private_network_name` fields will be ignored. +If you set the provider network name, the `openshift_openstack_external_network_name` and +`openshift_openstack_private_network_name` fields will be ignored. **NOTE**: this will not update the nodes' DNS, so running openshift-ansible right after provisioning will fail (unless you're using an external DNS server @@ -373,7 +373,7 @@ resolve each other by name. Configure required `*_ingress_cidr` variables to restrict public access to provisioned servers from your laptop (a /32 notation should be used) -or your trusted network. The most important is the `node_ingress_cidr` +or your trusted network. The most important is the `openshift_openstack_node_ingress_cidr` that restricts public access to the deployed DNS server and cluster nodes' ephemeral ports range. @@ -388,7 +388,7 @@ implications though, and is not recommended for production deployments. ### DNS servers security options -Aside from `node_ingress_cidr` restricting public access to in-stack DNS +Aside from `openshift_openstack_node_ingress_cidr` restricting public access to in-stack DNS servers, there are following (bind/named specific) DNS security options available: @@ -435,8 +435,8 @@ it up as the OpenShift hosted registry. To do that you need specify the desired Cinder volume name and size in Gigabytes in `inventory/group_vars/all.yml`: - cinder_hosted_registry_name: cinder-registry - cinder_hosted_registry_size_gb: 10 + openshift_openstack_cinder_hosted_registry_name: cinder-registry + openshift_openstack_cinder_hosted_registry_size_gb: 10 With this, the playbooks will create the volume and set up its filesystem. If there is an existing volume of the same name, we will @@ -483,8 +483,8 @@ the volume. If you're using the dynamic inventory, you must uncomment these two values as well: - #openshift_hosted_registry_storage_openstack_volumeID: "{{ lookup('os_cinder', cinder_hosted_registry_name).id }}" - #openshift_hosted_registry_storage_volume_size: "{{ cinder_hosted_registry_size_gb }}Gi" + #openshift_hosted_registry_storage_openstack_volumeID: "{{ lookup('os_cinder', openshift_openstack_cinder_hosted_registry_name).id }}" + #openshift_hosted_registry_storage_volume_size: "{{ openshift_openstack_cinder_hosted_registry_size_gb }}Gi" But note that they use the `os_cinder` lookup plugin we provide, so you must tell Ansible where to find it either in `ansible.cfg` (the one we provide is @@ -528,7 +528,7 @@ the **UUID** of the Cinder volume, *not its name*. We can do formate the volume for you if you ask for it in `inventory/group_vars/all.yml`: - prepare_and_format_registry_volume: true + openshift_openstack_prepare_and_format_registry_volume: true **NOTE:** doing so **will destroy any data that's currently on the volume**! @@ -544,16 +544,16 @@ You can also run the registry setup playbook directly: Example inventory variables: - openstack_use_bastion: true - bastion_ingress_cidr: "{{openstack_subnet_prefix}}.0/24" + openshift_openstack_use_bastion: true + openshift_openstack_bastion_ingress_cidr: "{{openshift_openstack_subnet_prefix}}.0/24" openstack_private_ssh_key: ~/.ssh/id_rsa openstack_inventory: static openstack_inventory_path: ../../../../inventory openstack_ssh_config_path: /tmp/ssh.config.openshift.ansible.openshift.example.com -The `openstack_subnet_prefix` is the openstack private network for your cluster. -And the `bastion_ingress_cidr` defines accepted range for SSH connections to nodes -additionally to the `ssh_ingress_cidr`` (see the security notes above). +The `openshift_openstack_subnet_prefix` is the openstack private network for your cluster. +And the `openshift_openstack_bastion_ingress_cidr` defines accepted range for SSH connections to nodes +additionally to the `openshift_openstack_ssh_ingress_cidr`` (see the security notes above). The SSH config will be stored on the ansible control node by the gitven path. Ansible uses it automatically. To access the cluster nodes with @@ -738,7 +738,7 @@ OpenShift UI may be accessed via the 1st master node FQDN, port 8443. When using a bastion, you may want to make an SSH tunnel from your control node to access UI on the `https://localhost:8443`, with this inventory variable: - openshift_ui_ssh_tunnel: True + openshift_openstack_ui_ssh_tunnel: True Note, this requires sudo rights on the ansible control node and an absolute path for the `openstack_private_ssh_key`. You should also update the control node's @@ -769,4 +769,4 @@ Usage: ansible-playbook -i openshift-ansible-contrib/playbooks/provisioning/openstack/scale-up.yaml` [-e increment_by=] [-e openshift_ansible_dir=] ``` -Note: This playbook works only without a bastion node (`openstack_use_bastion: False`). +Note: This playbook works only without a bastion node (`openshift_openstack_use_bastion: False`). diff --git a/playbooks/openstack/openshift-cluster/provision.yml b/playbooks/openstack/openshift-cluster/provision.yml index b1dff1870..fe3057158 100644 --- a/playbooks/openstack/openshift-cluster/provision.yml +++ b/playbooks/openstack/openshift-cluster/provision.yml @@ -42,8 +42,8 @@ name: openshift_openstack tasks_from: populate-dns.yml when: - - external_nsupdate_keys is defined - - external_nsupdate_keys.private is defined or external_nsupdate_keys.public is defined + - openshift_openstack_external_nsupdate_keys is defined + - openshift_openstack_external_nsupdate_keys.private is defined or openshift_openstack_external_nsupdate_keys.public is defined - name: Prepare the Nodes in the cluster for installation hosts: oo_all_hosts diff --git a/playbooks/openstack/sample-inventory/group_vars/OSEv3.yml b/playbooks/openstack/sample-inventory/group_vars/OSEv3.yml index 7d8dc157e..1e55adb9e 100644 --- a/playbooks/openstack/sample-inventory/group_vars/OSEv3.yml +++ b/playbooks/openstack/sample-inventory/group_vars/OSEv3.yml @@ -2,10 +2,10 @@ openshift_deployment_type: origin #openshift_deployment_type: openshift-enterprise #openshift_release: v3.5 -openshift_master_default_subdomain: "apps.{{ env_id }}.{{ public_dns_domain }}" +openshift_master_default_subdomain: "apps.{{ openshift_openstack_clusterid }}.{{ openshift_openstack_public_dns_domain }}" openshift_master_cluster_method: native -openshift_master_cluster_hostname: "console.{{ env_id }}.{{ public_dns_domain }}" +openshift_master_cluster_hostname: "console.{{ openshift_openstack_clusterid }}.{{ openshift_openstack_public_dns_domain }}" openshift_master_cluster_public_hostname: "{{ openshift_master_cluster_hostname }}" osm_default_node_selector: 'region=primary' @@ -29,10 +29,10 @@ openshift_hosted_registry_wait: True ## NOTE(shadower): This won't work until the openshift-ansible issue #5657 is fixed: ## https://github.com/openshift/openshift-ansible/issues/5657 -## If you're using the `cinder_hosted_registry_name` option from +## If you're using the `openshift_openstack_cinder_hosted_registry_name` option from ## `all.yml`, uncomment these lines: -#openshift_hosted_registry_storage_openstack_volumeID: "{{ lookup('os_cinder', cinder_hosted_registry_name).id }}" -#openshift_hosted_registry_storage_volume_size: "{{ cinder_hosted_registry_size_gb }}Gi" +#openshift_hosted_registry_storage_openstack_volumeID: "{{ lookup('os_cinder', openshift_openstack_cinder_hosted_registry_name).id }}" +#openshift_hosted_registry_storage_volume_size: "{{ openshift_openstack_cinder_hosted_registry_size_gb }}Gi" ## If you're using a Cinder volume you've set up yourself, uncomment these lines: #openshift_hosted_registry_storage_openstack_volumeID: e0ba2d73-d2f9-4514-a3b2-a0ced507fa05 diff --git a/playbooks/openstack/sample-inventory/group_vars/all.yml b/playbooks/openstack/sample-inventory/group_vars/all.yml index e0618d685..450642c81 100644 --- a/playbooks/openstack/sample-inventory/group_vars/all.yml +++ b/playbooks/openstack/sample-inventory/group_vars/all.yml @@ -1,59 +1,59 @@ --- -env_id: "openshift" -public_dns_domain: "example.com" -openstack_dns_nameservers: [] +openshift_openstack_clusterid: "openshift" +openshift_openstack_public_dns_domain: "example.com" +openshift_openstack_dns_nameservers: [] # # Used Hostnames # # - set custom hostnames for roles by uncommenting corresponding lines -#openstack_master_hostname: "master" -#openstack_infra_hostname: "infra-node" -#openstack_node_hostname: "app-node" -#openstack_lb_hostname: "lb" -#openstack_etcd_hostname: "etcd" -#openstack_dns_hostname: "dns" - -openstack_keypair_name: "openshift" -openstack_external_network_name: "public" -#openstack_private_network_name: "openshift-ansible-{{ stack_name }}-net" +#openshift_openstack_master_hostname: "master" +#openshift_openstack_infra_hostname: "infra-node" +#openshift_openstack_node_hostname: "app-node" +#openshift_openstack_lb_hostname: "lb" +#openshift_openstack_etcd_hostname: "etcd" +#openshift_openstack_dns_hostname: "dns" + +openshift_openstack_keypair_name: "openshift" +openshift_openstack_external_network_name: "public" +#openshift_openstack_private_network_name: "openshift-ansible-{{ openshift_openstack_stack_name }}-net" # # A dedicated Neutron network name for containers data network -# # Configures the data network to be separated from openstack_private_network_name +# # Configures the data network to be separated from openshift_openstack_private_network_name # # NOTE: this is only supported with Flannel SDN yet -#openstack_private_data_network_name: "openshift-ansible-{{ stack_name }}-data-net" +#openstack_private_data_network_name: "openshift-ansible-{{ openshift_openstack_stack_name }}-data-net" ## If you want to use a provider network, set its name here. -## NOTE: the `openstack_external_network_name` and -## `openstack_private_network_name` options will be ignored when using a +## NOTE: the `openshift_openstack_external_network_name` and +## `openshift_openstack_private_network_name` options will be ignored when using a ## provider network. -#openstack_provider_network_name: "provider" +#openshift_openstack_provider_network_name: "provider" # # Used Images # # - set specific images for roles by uncommenting corresponding lines -# # - note: do not remove openstack_default_image_name definition -#openstack_master_image_name: "centos7" -#openstack_infra_image_name: "centos7" -#openstack_node_image_name: "centos7" -#openstack_lb_image_name: "centos7" -#openstack_etcd_image_name: "centos7" -#openstack_dns_image_name: "centos7" -openstack_default_image_name: "centos7" - -openstack_num_masters: 1 -openstack_num_infra: 1 -openstack_num_nodes: 2 +# # - note: do not remove openshift_openstack_default_image_name definition +#openshift_openstack_master_image_name: "centos7" +#openshift_openstack_infra_image_name: "centos7" +#openshift_openstack_node_image_name: "centos7" +#openshift_openstack_lb_image_name: "centos7" +#openshift_openstack_etcd_image_name: "centos7" +#openshift_openstack_dns_image_name: "centos7" +openshift_openstack_default_image_name: "centos7" + +openshift_openstack_num_masters: 1 +openshift_openstack_num_infra: 1 +openshift_openstack_num_nodes: 2 # # Used Flavors # # - set specific flavors for roles by uncommenting corresponding lines -# # - note: do note remove openstack_default_flavor definition -#openstack_master_flavor: "m1.medium" -#openstack_infra_flavor: "m1.medium" -#openstack_node_flavor: "m1.medium" -#openstack_lb_flavor: "m1.medium" -#openstack_etcd_flavor: "m1.medium" -#openstack_dns_flavor: "m1.medium" -openstack_default_flavor: "m1.medium" +# # - note: do note remove openshift_openstack_default_flavor definition +#openshift_openstack_master_flavor: "m1.medium" +#openshift_openstack_infra_flavor: "m1.medium" +#openshift_openstack_node_flavor: "m1.medium" +#openshift_openstack_lb_flavor: "m1.medium" +#openshift_openstack_etcd_flavor: "m1.medium" +#openshift_openstack_dns_flavor: "m1.medium" +openshift_openstack_default_flavor: "m1.medium" # # Numerical index of nodes to remove -# openstack_nodes_to_remove: [] +# openshift_openstack_nodes_to_remove: [] # # Docker volume size # # - set specific volume size for roles by uncommenting corresponding lines @@ -69,22 +69,22 @@ docker_volume_size: "15" ## Specify server group policies for master and infra nodes. Nova must be configured to ## enable these policies. 'anti-affinity' will ensure that each VM is launched on a ## different physical host. -#openstack_master_server_group_policies: [anti-affinity] -#openstack_infra_server_group_policies: [anti-affinity] +#openshift_openstack_master_server_group_policies: [anti-affinity] +#openshift_openstack_infra_server_group_policies: [anti-affinity] ## Create a Cinder volume and use it for the OpenShift registry. ## NOTE: the openstack credentials and hosted registry options must be set in OSEv3.yml! -#cinder_hosted_registry_name: cinder-registry -#cinder_hosted_registry_size_gb: 10 +#openshift_openstack_cinder_hosted_registry_name: cinder-registry +#openshift_openstack_cinder_hosted_registry_size_gb: 10 ## Set up a filesystem on the cinder volume specified in `OSEv3.yaml`. ## You need to specify the file system and volume ID in OSEv3 via ## `openshift_hosted_registry_storage_openstack_filesystem` and ## `openshift_hosted_registry_storage_openstack_volumeID`. ## WARNING: This will delete any data on the volume! -#prepare_and_format_registry_volume: False +#openshift_openstack_prepare_and_format_registry_volume: False -openstack_subnet_prefix: "192.168.99" +openshift_openstack_subnet_prefix: "192.168.99" ## Red Hat subscription defaults to false which means we will not attempt to ## subscribe the nodes @@ -110,8 +110,8 @@ openstack_subnet_prefix: "192.168.99" # # Roll-your-own DNS -#openstack_num_dns: 0 -#external_nsupdate_keys: +#openshift_openstack_num_dns: 0 +#openshift_openstack_external_nsupdate_keys: # public: # key_secret: 'SKqKNdpfk7llKxZ57bbxUnUDobaaJp9t8CjXLJPl+fRI5mPcSBuxTAyvJPa6Y9R7vUg9DwCy/6WTpgLNqnV4Hg==' # key_algorithm: 'hmac-md5' @@ -131,16 +131,16 @@ openstack_subnet_prefix: "192.168.99" ansible_user: openshift # # Use a single security group for a cluster (default: false) -#openstack_flat_secgrp: false +#openshift_openstack_flat_secgrp: false # If you want to use the VM storage instead of Cinder volumes, set this to `true`. # NOTE: this is for testing only! Your data will be gone once the VM disappears! -# ephemeral_volumes: false +# openshift_openstack_ephemeral_volumes: false # # OpenShift node labels # # - in order to customise node labels for app and/or infra group, set the -# # openshift_cluster_node_labels variable -#openshift_cluster_node_labels: +# # openshift_openstack_cluster_node_labels variable +#openshift_openstack_cluster_node_labels: # app: # region: primary # infra: -- cgit v1.2.3