New file |
| | |
| | | [OSEv3:vars] |
| | | |
| | | # |
| | | # /etc/ansible/hosts file for OpenShift Container Platform 3.9.14 |
| | | # |
| | | ########################################################################### |
| | | ### Ansible Vars |
| | | ########################################################################### |
| | | timeout=60 |
| | | ansible_become=yes |
| | | ansible_ssh_user={{ansible_ssh_user}} |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Basic Vars |
| | | ########################################################################### |
| | | deployment_type=openshift-enterprise |
| | | containerized=false |
| | | openshift_disable_check="disk_availability,memory_availability,docker_image_availability" |
| | | |
| | | # default project node selector |
| | | osm_default_node_selector='env=users' |
| | | openshift_hosted_infra_selector={"env":"infra"} |
| | | |
| | | # Configure node kubelet arguments. pods-per-core is valid in OpenShift Origin 1.3 or OpenShift Container Platform 3.3 and later. |
| | | openshift_node_kubelet_args={'pods-per-core': ['10'], 'max-pods': ['250'], 'image-gc-high-threshold': ['85'], 'image-gc-low-threshold': ['75']} |
| | | |
| | | # Configure logrotate scripts |
| | | # See: https://github.com/nickhammond/ansible-logrotate |
| | | logrotate_scripts=[{"name": "syslog", "path": "/var/log/cron\n/var/log/maillog\n/var/log/messages\n/var/log/secure\n/var/log/spooler\n", "options": ["daily", "rotate 7","size 500M", "compress", "sharedscripts", "missingok"], "scripts": {"postrotate": "/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true"}}] |
| | | |
| | | {% if install_glusterfs|bool %} |
| | | ########################################################################### |
| | | ### Glusterfs |
| | | ########################################################################### |
| | | openshift_storage_glusterfs_namespace=glusterfs |
| | | openshift_storage_glusterfs_name=storage |
| | | openshift_storage_glusterfs_storageclass_default=true |
| | | #openshift_storage_glusterfs_wipe=True |
| | | openshift_master_dynamic_provisioning_enabled=True |
| | | #dynamic_volumes_check=False |
| | | {% endif %} |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Cockpit Vars |
| | | ########################################################################### |
| | | |
| | | # Enable cockpit |
| | | osm_use_cockpit=true |
| | | osm_cockpit_plugins=['cockpit-kubernetes'] |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Master Vars |
| | | ########################################################################### |
| | | |
| | | openshift_master_api_port={{master_api_port}} |
| | | openshift_master_console_port={{master_api_port}} |
| | | |
| | | openshift_master_cluster_method=native |
| | | openshift_master_cluster_hostname={{master_lb_dns}} |
| | | openshift_master_cluster_public_hostname={{master_lb_dns}} |
| | | openshift_master_default_subdomain={{cloudapps_suffix}} |
| | | openshift_master_overwrite_named_certificates={{openshift_master_overwrite_named_certificates}} |
| | | |
| | | {% if install_lets_encrypt_certificates|bool %} |
| | | openshift_master_named_certificates=[{"certfile": "/root/.acme.sh/{{ master_lb_dns }}/{{ master_lb_dns }}.cer", "keyfile": "/root/.acme.sh/{{ master_lb_dns }}/{{ master_lb_dns }}.key", "cafile": "/root/lets-encrypt-x3-cross-signed.pem"}] |
| | | {% endif %} |
| | | |
| | | openshift_set_hostname=True |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Network Vars |
| | | ########################################################################### |
| | | |
| | | osm_cluster_network_cidr=10.1.0.0/16 |
| | | openshift_portal_net=172.30.0.0/16 |
| | | |
| | | #os_sdn_network_plugin_name='redhat/openshift-ovs-networkpolicy' |
| | | {{multi_tenant_setting}} |
| | | |
| | | # This should be turned on once all dependent scripts use firewalld rather than iptables |
| | | # os_firewall_use_firewalld=True |
| | | |
| | | ########################################################################### |
| | | ### OpenShift admission plugin config |
| | | ########################################################################### |
| | | |
| | | openshift_master_admission_plugin_config={} |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Authentication Vars |
| | | ########################################################################### |
| | | |
| | | {% if install_idm == "ldap" %} |
| | | openshift_master_identity_providers=[{'name': 'ldap', 'challenge': 'true', 'login': 'true', 'kind': 'LDAPPasswordIdentityProvider','attributes': {'id': ['dn'], 'email': ['mail'], 'name': ['cn'], 'preferredUsername': ['uid']}, 'bindDN': 'uid=ose-mwl-auth,cn=users,cn=accounts,dc=opentlc,dc=com', 'bindPassword': '{{bindPassword}}', 'ca': 'ipa-ca.crt','insecure': 'false', 'url': 'ldaps://ipa1.opentlc.com:636/cn=users,cn=accounts,dc=opentlc,dc=com?uid'}] |
| | | {{openshift_master_ldap_ca_file}} |
| | | {% endif %} |
| | | |
| | | {% if install_idm == "allow_all" %} |
| | | openshift_master_identity_providers=[{'name': 'allow_all', 'login': 'true', 'challenge': 'true', 'kind': 'AllowAllPasswordIdentityProvider'}] |
| | | {% endif %} |
| | | |
| | | {% if install_idm == "htpasswd" %} |
| | | # htpasswd auth |
| | | openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}] |
| | | # Defining htpasswd users |
| | | #openshift_master_htpasswd_users={'user1': '<pre-hashed password>', 'user2': '<pre-hashed password>'} |
| | | # or |
| | | openshift_master_htpasswd_file=/root/htpasswd.openshift |
| | | {% endif %} |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Metrics and Logging Vars |
| | | ########################################################################### |
| | | |
| | | # Enable cluster metrics |
| | | ######################## |
| | | openshift_metrics_install_metrics={{install_metrics}} |
| | | |
| | | {% if install_nfs|bool and not install_glusterfs|bool %} |
| | | openshift_metrics_storage_kind=nfs |
| | | openshift_metrics_storage_access_modes=['ReadWriteOnce'] |
| | | openshift_metrics_storage_nfs_directory=/srv/nfs |
| | | openshift_metrics_storage_nfs_options='*(rw,root_squash)' |
| | | openshift_metrics_storage_volume_name=metrics |
| | | openshift_metrics_storage_volume_size=10Gi |
| | | openshift_metrics_storage_labels={'storage': 'metrics'} |
| | | openshift_metrics_cassanda_pvc_storage_class_name='' |
| | | {% endif %} |
| | | |
| | | openshift_metrics_cassandra_nodeselector={"env":"infra"} |
| | | openshift_metrics_hawkular_nodeselector={"env":"infra"} |
| | | openshift_metrics_heapster_nodeselector={"env":"infra"} |
| | | |
| | | # Add Prometheus Metrics: |
| | | ######################### |
| | | openshift_hosted_prometheus_deploy=true |
| | | openshift_prometheus_node_selector={"env":"infra"} |
| | | openshift_prometheus_namespace=openshift-metrics |
| | | |
| | | # Prometheus |
| | | {% if install_glusterfs|bool %} |
| | | openshift_prometheus_storage_kind=dynamic |
| | | openshift_prometheus_storage_volume_size=20Gi |
| | | {% elif install_nfs|bool %} |
| | | openshift_prometheus_storage_kind=nfs |
| | | openshift_prometheus_storage_nfs_directory=/srv/nfs |
| | | openshift_prometheus_storage_nfs_options='*(rw,root_squash)' |
| | | openshift_prometheus_storage_volume_size=10Gi |
| | | openshift_prometheus_storage_labels={'storage': 'prometheus'} |
| | | {% endif %} |
| | | openshift_prometheus_storage_access_modes=['ReadWriteOnce'] |
| | | openshift_prometheus_storage_volume_name=prometheus |
| | | openshift_prometheus_storage_type='pvc' |
| | | |
| | | # For prometheus-alertmanager |
| | | {% if install_glusterfs|bool %} |
| | | openshift_prometheus_alertmanager_storage_kind=dynamic |
| | | {% elif install_nfs|bool %} |
| | | openshift_prometheus_alertmanager_storage_kind=nfs |
| | | openshift_prometheus_alertmanager_storage_nfs_directory=/srv/nfs |
| | | openshift_prometheus_alertmanager_storage_nfs_options='*(rw,root_squash)' |
| | | openshift_prometheus_alertmanager_storage_labels={'storage': 'prometheus-alertmanager'} |
| | | {% endif %} |
| | | openshift_prometheus_alertmanager_storage_access_modes=['ReadWriteOnce'] |
| | | openshift_prometheus_alertmanager_storage_volume_size=10Gi |
| | | openshift_prometheus_alertmanager_storage_volume_name=prometheus-alertmanager |
| | | openshift_prometheus_alertmanager_storage_type='pvc' |
| | | |
| | | # For prometheus-alertbuffer |
| | | {% if install_glusterfs|bool %} |
| | | openshift_prometheus_alertbuffer_storage_kind=dynamic |
| | | {% elif install_nfs|bool %} |
| | | openshift_prometheus_alertbuffer_storage_kind=nfs |
| | | openshift_prometheus_alertbuffer_storage_nfs_directory=/srv/nfs |
| | | openshift_prometheus_alertbuffer_storage_nfs_options='*(rw,root_squash)' |
| | | openshift_prometheus_alertbuffer_storage_labels={'storage': 'prometheus-alertbuffer'} |
| | | {% endif %} |
| | | openshift_prometheus_alertbuffer_storage_access_modes=['ReadWriteOnce'] |
| | | openshift_prometheus_alertbuffer_storage_volume_name=prometheus-alertbuffer |
| | | openshift_prometheus_alertbuffer_storage_volume_size=10Gi |
| | | openshift_prometheus_alertbuffer_storage_type='pvc' |
| | | |
| | | # Necessary for 3.9.14 |
| | | openshift_prometheus_node_exporter_image_version=v3.9 |
| | | |
| | | |
| | | # Enable cluster logging |
| | | ######################## |
| | | openshift_logging_install_logging={{install_logging}} |
| | | |
| | | {% if install_nfs|bool and not install_glusterfs|bool %} |
| | | openshift_logging_storage_kind=nfs |
| | | openshift_logging_storage_access_modes=['ReadWriteOnce'] |
| | | openshift_logging_storage_nfs_directory=/srv/nfs |
| | | openshift_logging_storage_nfs_options='*(rw,root_squash)' |
| | | openshift_logging_storage_volume_name=logging |
| | | openshift_logging_storage_volume_size=10Gi |
| | | openshift_logging_storage_labels={'storage': 'logging'} |
| | | openshift_logging_es_pvc_storage_class_name='' |
| | | {% endif %} |
| | | |
| | | openshift_logging_es_cluster_size=1 |
| | | openshift_logging_es_nodeselector={"env":"infra"} |
| | | openshift_logging_kibana_nodeselector={"env":"infra"} |
| | | openshift_logging_curator_nodeselector={"env":"infra"} |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Project Management Vars |
| | | ########################################################################### |
| | | |
| | | # Configure additional projects |
| | | # openshift_additional_projects={'my-infra-project-test': {'default_node_selector': 'env=infra'}} |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Router and Registry Vars |
| | | ########################################################################### |
| | | |
| | | openshift_hosted_router_selector='env=infra' |
| | | openshift_hosted_router_replicas={{infranode_instance_count}} |
| | | |
| | | {% if install_lets_encrypt_certificates|bool %} |
| | | openshift_hosted_router_certificate={"certfile": "/root/.acme.sh/{{ master_lb_dns }}/{{ master_lb_dns }}.cer", "keyfile": "/root/.acme.sh/{{ master_lb_dns }}/{{ master_lb_dns }}.key", "cafile": "/root/lets-encrypt-x3-cross-signed.pem"} |
| | | {% endif %} |
| | | |
| | | openshift_hosted_registry_selector='env=infra' |
| | | openshift_hosted_registry_replicas=1 |
| | | openshift_hosted_registry_pullthrough=true |
| | | openshift_hosted_registry_acceptschema2=true |
| | | openshift_hosted_registry_enforcequota=true |
| | | |
| | | {% if s3user_access_key is defined %} |
| | | # Registry AWS S3 |
| | | # S3 bucket must already exist. |
| | | openshift_hosted_registry_storage_kind=object |
| | | openshift_hosted_registry_storage_provider=s3 |
| | | openshift_hosted_registry_storage_s3_accesskey={{ s3user_access_key }} |
| | | openshift_hosted_registry_storage_s3_secretkey={{ s3user_secret_access_key }} |
| | | openshift_hosted_registry_storage_s3_bucket={{ project_tag }} |
| | | openshift_hosted_registry_storage_s3_region={{ aws_region }} |
| | | openshift_hosted_registry_storage_s3_chunksize=26214400 |
| | | openshift_hosted_registry_storage_s3_rootdirectory=/registry |
| | | {% endif %} |
| | | |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Service Catalog Vars |
| | | ########################################################################### |
| | | |
| | | openshift_enable_service_catalog=true |
| | | |
| | | template_service_broker_install=true |
| | | template_service_broker_selector={"env":"infra"} |
| | | openshift_template_service_broker_namespaces=['openshift'] |
| | | |
| | | ansible_service_broker_install=true |
| | | ansible_service_broker_local_registry_whitelist=['.*-apb$'] |
| | | |
| | | {% if install_glusterfs|bool %} |
| | | openshift_hosted_etcd_storage_kind=dynamic |
| | | {% elif install_nfs|bool %} |
| | | openshift_hosted_etcd_storage_kind=nfs |
| | | openshift_hosted_etcd_storage_nfs_options="*(rw,root_squash,sync,no_wdelay)" |
| | | openshift_hosted_etcd_storage_nfs_directory=/srv/nfs |
| | | openshift_hosted_etcd_storage_labels={'storage': 'etcd-asb'} |
| | | {% endif %} |
| | | openshift_hosted_etcd_storage_volume_name=etcd-asb |
| | | openshift_hosted_etcd_storage_access_modes=['ReadWriteOnce'] |
| | | openshift_hosted_etcd_storage_volume_size=10G |
| | | |
| | | ########################################################################### |
| | | ### OpenShift Hosts |
| | | ########################################################################### |
| | | [OSEv3:children] |
| | | masters |
| | | etcd |
| | | nodes |
| | | {% if install_nfs|bool %} |
| | | nfs |
| | | {% endif %} |
| | | {% if install_glusterfs|bool %} |
| | | glusterfs |
| | | {% endif %} |
| | | {% if groups['newnodes']|d([])|length > 0 %} |
| | | new_nodes |
| | | {% endif %} |
| | | |
| | | [masters] |
| | | {% for host in groups['masters'] %} |
| | | {{ hostvars[host].internaldns }} host_zone={{hostvars[host]['placement']}} |
| | | {% endfor %} |
| | | |
| | | [etcd] |
| | | {% for host in groups['masters'] %} |
| | | {{ hostvars[host].internaldns }} host_zone={{hostvars[host]['placement']}} |
| | | {% endfor %} |
| | | |
| | | [nodes] |
| | | ## These are the masters |
| | | {% for host in groups['masters'] %} |
| | | {{ hostvars[host].internaldns }} openshift_hostname={{ hostvars[host].internaldns }} openshift_node_labels="{'logging':'true','openshift_schedulable':'False','cluster': '{{guid}}', 'zone': '{{hostvars[host]['placement']}}'}" |
| | | {% endfor %} |
| | | |
| | | ## These are infranodes |
| | | {% for host in groups['infranodes'] %} |
| | | {{ hostvars[host].internaldns }} openshift_hostname={{ hostvars[host].internaldns }} openshift_node_labels="{'logging':'true','cluster': '{{guid}}', 'env':'infra', 'zone': '{{hostvars[host]['placement']}}'}" |
| | | {% endfor %} |
| | | |
| | | ## These are regular nodes |
| | | {% for host in groups['nodes'] |
| | | if host not in groups['newnodes']|d([]) |
| | | and host not in groups['glusterfs']|d([]) |
| | | %} |
| | | {{ hostvars[host].internaldns }} openshift_hostname={{ hostvars[host].internaldns }} openshift_node_labels="{'logging':'true','cluster': '{{guid}}', 'env':'users', 'zone': '{{hostvars[host]['placement']}}'}" |
| | | {% endfor %} |
| | | |
| | | {% if groups['glusterfs']|d([])|length > 0 %} |
| | | ## These are glusterfs nodes |
| | | {% for host in groups['glusterfs'] %} |
| | | {{ hostvars[host].internaldns }} openshift_hostname={{ hostvars[host].internaldns }} openshift_node_labels="{'logging':'true','cluster': '{{guid}}', 'env':'glusterfs', 'zone': '{{hostvars[host]['placement']}}'}" |
| | | {% endfor %} |
| | | {% endif %} |
| | | |
| | | {% if groups['newnodes']|d([])|length > 0 %} |
| | | # scaleup performed, leave an empty group, see: |
| | | # https://docs.openshift.com/container-platform/3.7/install_config/adding_hosts_to_existing_cluster.html |
| | | [new_nodes] |
| | | {% for host in groups['newnodes'] %} |
| | | {{ hostvars[host].internaldns }} openshift_hostname={{ hostvars[host].internaldns }} ansible_ssh_user={{remote_user}} ansible_ssh_private_key_file=~/.ssh/{{key_name}}.pem openshift_node_labels="{'logging':'true','cluster': '{{guid}}', 'env':'users', 'zone': '{{hostvars[host]['placement']}}'}" |
| | | {% endfor %} |
| | | {% endif %} |
| | | |
| | | {% if install_nfs|bool %} |
| | | [nfs] |
| | | {% for host in [groups['support']|sort|first] %} |
| | | {{ hostvars[host].internaldns }} openshift_hostname={{ hostvars[host].internaldns }} |
| | | {% endfor %} |
| | | {% endif %} |
| | | |
| | | {% if install_glusterfs|bool %} |
| | | {% set query = "[?name=='support']|[0].volumes[?purpose=='glusterfs'].device_name" %} |
| | | [glusterfs] |
| | | {% for host in groups['glusterfs'] %} |
| | | {{ hostvars[host].internaldns }} glusterfs_ip={{hostvars[host].private_ip_address}} glusterfs_devices='{{instances|json_query(query)|to_json}}' |
| | | {% endfor %} |
| | | {% endif %} |