Import Hiera roles

The hiera roles (data and upgrade) have been imported. These roles will now
be tested using molecule which will ensure functionality via multiple
scenarios tests which should provide coverage for all currently available
code path's.

Because these roles use the ip filter from Ansible a change to the test
requirements has been made to include the require python library, netaddr.

Hieradata Test Matrix:
  - Default - Runs through the role top to bottom with all default
              settings
  - hieradata_vars - Rests role include functionality to generate
                     hiera templates
  - per-host - Tests running with hiera config with host specific
               values
  - all-hosts - Tests running through a standard multi-node deployment
                using mock hieradata

Hiera Upgrade Test Matix:
  - Default - Runs through the role top to bottom with all default
              settings

To ensure we maintain coverage for the hieradata and upgrade roles
additional voting scenario jobs have been added to the layout. These
jobs will execute whenever a change is made to either of the hiera
roles ensuring we're not experiencing any regressions on a critical
part of our deployment process.

Story: 2006044
Task: 34726
Task: 34728
Task: 34729
Story: 2006044
Task: 34730
Task: 34732
Task: 34733
Change-Id: I7f9e993735a0347aac12f728393639d88c80ff0f
Signed-off-by: Kevin Carter <kecarter@redhat.com>
changes/64/673364/21
Kevin Carter 3 years ago committed by Kevin Carter
parent 9204dbce60
commit 9743b73de6
  1. 6
      doc/source/roles/role-tripleo-hieradata.rst
  2. 6
      doc/source/roles/role-tripleo-upgrade-hiera.rst
  3. 3
      test-requirements.txt
  4. 54
      tripleo_ansible/roles/tripleo-hieradata/defaults/main.yml
  5. 22
      tripleo_ansible/roles/tripleo-hieradata/handlers/main.yml
  6. 44
      tripleo_ansible/roles/tripleo-hieradata/meta/main.yml
  7. 37
      tripleo_ansible/roles/tripleo-hieradata/molecule/all-hosts/Dockerfile
  8. 1111
      tripleo_ansible/roles/tripleo-hieradata/molecule/all-hosts/mock-hieradata.j2.yaml
  9. 48
      tripleo_ansible/roles/tripleo-hieradata/molecule/all-hosts/molecule.yml
  10. 22
      tripleo_ansible/roles/tripleo-hieradata/molecule/all-hosts/playbook.yml
  11. 21
      tripleo_ansible/roles/tripleo-hieradata/molecule/all-hosts/prepare.yml
  12. 28
      tripleo_ansible/roles/tripleo-hieradata/molecule/all-hosts/tests/test_default.py
  13. 37
      tripleo_ansible/roles/tripleo-hieradata/molecule/default/Dockerfile
  14. 48
      tripleo_ansible/roles/tripleo-hieradata/molecule/default/molecule.yml
  15. 21
      tripleo_ansible/roles/tripleo-hieradata/molecule/default/playbook.yml
  16. 21
      tripleo_ansible/roles/tripleo-hieradata/molecule/default/prepare.yml
  17. 37
      tripleo_ansible/roles/tripleo-hieradata/molecule/hieradata_vars/Dockerfile
  18. 3
      tripleo_ansible/roles/tripleo-hieradata/molecule/hieradata_vars/mock-hieradata.j2.yaml
  19. 225
      tripleo_ansible/roles/tripleo-hieradata/molecule/hieradata_vars/molecule.yml
  20. 46
      tripleo_ansible/roles/tripleo-hieradata/molecule/hieradata_vars/playbook.yml
  21. 21
      tripleo_ansible/roles/tripleo-hieradata/molecule/hieradata_vars/prepare.yml
  22. 44
      tripleo_ansible/roles/tripleo-hieradata/molecule/hieradata_vars/tests/test_hieradata_vars.py
  23. 37
      tripleo_ansible/roles/tripleo-hieradata/molecule/per-host/Dockerfile
  24. 16
      tripleo_ansible/roles/tripleo-hieradata/molecule/per-host/mock-hieradata.j2.yaml
  25. 48
      tripleo_ansible/roles/tripleo-hieradata/molecule/per-host/molecule.yml
  26. 26
      tripleo_ansible/roles/tripleo-hieradata/molecule/per-host/playbook.yml
  27. 21
      tripleo_ansible/roles/tripleo-hieradata/molecule/per-host/prepare.yml
  28. 29
      tripleo_ansible/roles/tripleo-hieradata/molecule/per-host/tests/test_default.py
  29. 24
      tripleo_ansible/roles/tripleo-hieradata/tasks/all_hosts.yml
  30. 21
      tripleo_ansible/roles/tripleo-hieradata/tasks/hieradata_vars.yaml
  31. 74
      tripleo_ansible/roles/tripleo-hieradata/tasks/main.yml
  32. 22
      tripleo_ansible/roles/tripleo-hieradata/tasks/per_host.yml
  33. 42
      tripleo_ansible/roles/tripleo-hieradata/templates/all_nodes.j2
  34. 4
      tripleo_ansible/roles/tripleo-hieradata/templates/bootstrap_node.j2
  35. 4
      tripleo_ansible/roles/tripleo-hieradata/templates/cloud_domain.j2
  36. 1
      tripleo_ansible/roles/tripleo-hieradata/templates/extraconfig.j2
  37. 12
      tripleo_ansible/roles/tripleo-hieradata/templates/fqdn.j2
  38. 18
      tripleo_ansible/roles/tripleo-hieradata/templates/net_ip_map.j2
  39. 1
      tripleo_ansible/roles/tripleo-hieradata/templates/role_extraconfig.j2
  40. 1
      tripleo_ansible/roles/tripleo-hieradata/templates/service_configs.j2
  41. 45
      tripleo_ansible/roles/tripleo-hieradata/templates/vip_data.j2
  42. 17
      tripleo_ansible/roles/tripleo-upgrade-hiera/defaults/main.yml
  43. 44
      tripleo_ansible/roles/tripleo-upgrade-hiera/meta/main.yml
  44. 37
      tripleo_ansible/roles/tripleo-upgrade-hiera/molecule/default/Dockerfile
  45. 48
      tripleo_ansible/roles/tripleo-upgrade-hiera/molecule/default/molecule.yml
  46. 62
      tripleo_ansible/roles/tripleo-upgrade-hiera/molecule/default/playbook.yml
  47. 21
      tripleo_ansible/roles/tripleo-upgrade-hiera/molecule/default/prepare.yml
  48. 54
      tripleo_ansible/roles/tripleo-upgrade-hiera/tasks/create-tripleo-upgrade-file.yml
  49. 21
      tripleo_ansible/roles/tripleo-upgrade-hiera/tasks/main.yml
  50. 21
      tripleo_ansible/roles/tripleo-upgrade-hiera/tasks/remove-all.yml
  51. 37
      tripleo_ansible/roles/tripleo-upgrade-hiera/tasks/remove.yml
  52. 29
      tripleo_ansible/roles/tripleo-upgrade-hiera/tasks/set.yml
  53. 55
      zuul.d/layout.yaml
  54. 18
      zuul.d/molecule.yaml

@ -0,0 +1,6 @@
========================
Role - tripleo-hieradata
========================
.. ansibleautoplugin::
:role: tripleo_ansible/roles/tripleo-hieradata

@ -0,0 +1,6 @@
============================
Role - tripleo-upgrade-hiera
============================
.. ansibleautoplugin::
:role: tripleo_ansible/roles/tripleo-upgrade-hiera

@ -1 +1,2 @@
pre-commit # MIT
pre-commit # MIT
netaddr # BSD

@ -0,0 +1,54 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# `hieradata_content` can be formatted for all hosts or for specific hosts
# containing potentially different values.
#
# Host specific example:
#
# controller1:
# extraconfig:
# foo: bar
# foo2: bar2
# other_hierafile:
# foo: bar3
# controller2:
# extraconfig:
# foo: bar2
# foo2: bar3
# other_hierafile:
# foo: bar
#
#
# Global format example:
#
# extraconfig:
# foo: bar
# foo2: bar2
# other_hierafile:
# foo: bar3
#
hieradata_template: ""
hieradata_files: []
# jinja2 escape trick for simple {{ and }} strings:
hieradata_variable_start_string: "{{ '{{' }}"
hieradata_variable_end_string: "{{ '}}' }}"
hieradata_per_host: false
hieradata_templates_list:
- bootstrap_node
- all_nodes
- vip_data

@ -0,0 +1,22 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Cleanup temp file
file:
path: "{{ tempfile_1.path }}"
state: absent
delegate_to: localhost
connection: local

@ -0,0 +1,44 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
galaxy_info:
author: OpenStack
description: TripleO OpenStack Role -- tripleo-hieradata
company: Red Hat
license: Apache-2.0
min_ansible_version: 2.7
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: Fedora
versions:
- 28
- name: CentOS
versions:
- 7
galaxy_tags:
- tripleo
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []

@ -0,0 +1,37 @@
# Molecule managed
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi
{% for pkg in item.easy_install | default([]) %}
# install pip for centos where there is no python-pip rpm in default repos
RUN easy_install {{ pkg }}
{% endfor %}
CMD ["sh", "-c", "while true; do sleep 10000; done"]

@ -0,0 +1,48 @@
---
driver:
name: docker
log: true
platforms:
- name: centos7
hostname: centos7
image: centos:7
dockerfile: Dockerfile
pkg_extras: python-setuptools
easy_install:
- pip
environment: &env
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
- name: fedora28
hostname: fedora28
image: fedora:28
dockerfile: Dockerfile
pkg_extras: python*-setuptools
environment:
<<: *env
provisioner:
name: ansible
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
lint:
enabled: false
verifier:
name: testinfra
lint:
name: flake8

@ -0,0 +1,22 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Converge
hosts: all
roles:
- role: tripleo-hieradata
hieradata_template: "{{ playbook_dir }}/mock-hieradata.j2.yaml"

@ -0,0 +1,21 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Prepare
hosts: all
roles:
- role: test_deps

@ -0,0 +1,28 @@
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import json
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hieradata_files(host):
assert host.file("/etc/puppet/hieradata/standalone_extraconfig.json").exists

@ -0,0 +1,37 @@
# Molecule managed
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi
{% for pkg in item.easy_install | default([]) %}
# install pip for centos where there is no python-pip rpm in default repos
RUN easy_install {{ pkg }}
{% endfor %}
CMD ["sh", "-c", "while true; do sleep 10000; done"]

@ -0,0 +1,48 @@
---
driver:
name: docker
log: true
platforms:
- name: centos7
hostname: centos7
image: centos:7
dockerfile: Dockerfile
pkg_extras: python-setuptools
easy_install:
- pip
environment: &env
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
- name: fedora28
hostname: fedora28
image: fedora:28
dockerfile: Dockerfile
pkg_extras: python*-setuptools
environment:
<<: *env
provisioner:
name: ansible
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
lint:
enabled: false
verifier:
name: testinfra
lint:
name: flake8

@ -0,0 +1,21 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Converge
hosts: all
roles:
- role: tripleo-hieradata

@ -0,0 +1,21 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Prepare
hosts: all
roles:
- role: test_deps

@ -0,0 +1,37 @@
# Molecule managed
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi
{% for pkg in item.easy_install | default([]) %}
# install pip for centos where there is no python-pip rpm in default repos
RUN easy_install {{ pkg }}
{% endfor %}
CMD ["sh", "-c", "while true; do sleep 10000; done"]

@ -0,0 +1,225 @@
---
driver:
name: docker
log: true
platforms:
- name: centos7
hostname: centos7
image: centos:7
dockerfile: Dockerfile
pkg_extras: python-setuptools
easy_install:
- pip
environment: &env
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
- name: fedora28
hostname: fedora28
image: fedora:28
dockerfile: Dockerfile
pkg_extras: python*-setuptools
environment:
<<: *env
provisioner:
name: ansible
inventory:
hosts:
all:
vars:
all_nodes_extra_map_data: {}
bootstrap_nodeid: standalone
cloud_domain: localdomain
cloud_names:
cloud_name_ctlplane: standalone.ctlplane.localdomain
container_cli: podman
control_virtual_ip: 192.168.24.1
ctlplane_ip: 192.168.24.2
ctlplane_subnet_cidr: 24
deploy_artifact_urls: ''
deploy_identifier: '1564455089'
deploy_steps_max: 6
enable_internal_tls: false
enabled_networks: []
enabled_services:
- keystone_admin_api
- keystone_public_api
- ca_certs
- ceph_client
- ceph_mds
- ceph_mgr
- ceph_mon
- ceph_rgw
- ceph_osd
- certmonger_user
- clustercheck
- container_image_prepare
- logrotate_crond
- docker
- docker_registry
- glance_api
- haproxy
- iscsid
- kernel
- keystone
- manila_api
- manila_backend_cephfs
- manila_scheduler
- manila_share
- memcached
- mysql
- mysql_client
- neutron_api
- neutron_plugin_ml2_ovn
- nova_api
- nova_compute
- nova_conductor
- nova_libvirt
- nova_metadata
- nova_migration_target
- nova_scheduler
- nova_vnc_proxy
- ovn_controller
- ovn_dbs
- ovn_metadata
- openstack_clients
- oslo_messaging_notify
- oslo_messaging_rpc
- pacemaker
- placement
- podman
- snmp
- sshd
- chrony
- timezone
- logrotate_tmpwatch
- tripleo_firewall
- tripleo_packages
- tuned
extraconfig:
foo: bar1
foo2: bar2
hosts_entry: '
192.168.24.1 standalone.localdomain standalone
192.168.24.1 standalone.ctlplane.localdomain standalone.ctlplane
'
net_vip_map:
ctlplane: 192.168.24.1
ctlplane_subnet: 192.168.24.1/24
ctlplane_uri: 192.168.24.1
redis: 192.168.24.1
network_virtual_ips:
ctlplane:
index: 1
ip_address: 192.168.24.1
network_cidrs:
External_cidr: 192.168.24.2/24
networks: null
nova_additional_cell: false
ping_test_ips:
Standalone: 192.168.24.1
primary_role_name: Standalone
role_networks:
- Internal
service_configs:
foo: bar3
service_net_map:
aodh_api_network: ctlplane
apache_network: ctlplane
barbican_api_network: ctlplane
bindnetwork: ctlplane
ceph_cluster_network: ctlplane
ceph_grafana_network: ctlplane
ceph_mon_network: ctlplane
ceph_rgw_network: ctlplane
cinder_api_network: ctlplane
cinder_iscsi_network: ctlplane
designate_api_network: ctlplane
docker_registry_network: ctlplane
ec2_api_metadata_network: ctlplane
ec2_api_network: ctlplane
etcd_network: ctlplane
ganesha_network: ctlplane
glance_api_network: ctlplane
gnocchi_api_network: ctlplane
haproxy_network: ctlplane
heat_api_cfn_network: ctlplane
heat_api_cloudwatch_network: ctlplane
heat_api_network: ctlplane
horizon_network: ctlplane
ironic_api_network: ctlplane
ironic_inspector_network: ctlplane
ironic_network: ctlplane
keystone_admin_api_network: ctlplane
keystone_public_api_network: ctlplane
manila_api_network: ctlplane
memcached_network: ctlplane
metrics_qdr_network: ctlplane
mistral_api_network: ctlplane
mongodb_network: ctlplane
mysql_network: ctlplane
neutron_api_network: ctlplane
neutron_tenant_network: ctlplane
nova_api_network: ctlplane
nova_libvirt_network: ctlplane
nova_metadata_network: ctlplane
nova_vnc_proxy_network: ctlplane
novajoin_network: ctlplane
octavia_api_network: ctlplane
opendaylight_api_network: ctlplane
openshift_infra_network: ctlplane
openshift_master_network: ctlplane
oslo_messaging_notify_network: ctlplane
oslo_messaging_rpc_network: ctlplane
ovn_dbs_network: ctlplane
pacemaker_network: ctlplane
pacemaker_remote_network: ctlplane
panko_api_network: ctlplane
placement_network: ctlplane
public_network: ctlplane
qdr_network: ctlplane
rabbitmq_network: ctlplane
redis_network: ctlplane
sahara_api_network: ctlplane
snmpd_network: ctlplane
standalone_hostname_resolve_network: ctlplane
swift_proxy_network: ctlplane
swift_storage_network: ctlplane
tacker_api_network: ctlplane
zaqar_api_network: ctlplane
stack_action: CREATE
stack_update_type: ''
validate_controllers_icmp: true
validate_fqdn: false
validate_gateways_icmp: true
validate_ntp: true
Standalone:
hosts:
fedora28: {}
centos7: {}
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
lint:
enabled: false
verifier:
name: testinfra
lint:
name: flake8

@ -0,0 +1,46 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Converge
hosts: all
pre_tasks:
- name: Create puppet hieradata directory
file:
path: /etc/puppet/hieradata
state: directory
- name: Set mock network ip facts
set_fact:
CTRLPlane_ip: 192.168.24.2
ctlplane_ip: 192.168.24.2
Internal_ip: 192.168.25.2
tasks:
- name: Create hieradata from templates
include_role:
name: tripleo-hieradata
tasks_from: hieradata_vars.yaml
vars:
hieradata_templates_list:
- all_nodes
- bootstrap_node
- cloud_domain
- extraconfig
- fqdn
- net_ip_map
- service_configs
- vip_data

@ -0,0 +1,21 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Prepare
hosts: all
roles:
- role: test_deps

@ -0,0 +1,44 @@
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import json
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_json_render(host):
rendered_files = [
"all_nodes",
"bootstrap_node",
"cloud_domain",
"extraconfig",
"fqdn",
"net_ip_map",
"service_configs",
"vip_data"
]
for f in rendered_files:
json.loads(
host.file(
'/etc/puppet/hieradata/{}.json'.format(f)
).content_string
)

@ -0,0 +1,37 @@
# Molecule managed
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi
{% for pkg in item.easy_install | default([]) %}
# install pip for centos where there is no python-pip rpm in default repos
RUN easy_install {{ pkg }}
{% endfor %}
CMD ["sh", "-c", "while true; do sleep 10000; done"]

@ -0,0 +1,16 @@
---
fedora28:
datafiles:
extraconfig:
foo: bar1
foo2: bar2
service_configs:
foo: bar3
centos7:
datafiles:
extraconfig:
foo: bar1
foo2: bar2
service_configs:
foo: bar3

@ -0,0 +1,48 @@
---
driver:
name: docker
log: true
platforms:
- name: centos7
hostname: centos7
image: centos:7
dockerfile: Dockerfile
pkg_extras: python-setuptools
easy_install:
- pip
environment: &env
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
- name: fedora28
hostname: fedora28
image: fedora:28
dockerfile: Dockerfile
pkg_extras: python*-setuptools
environment:
<<: *env
provisioner:
name: ansible
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
lint:
enabled: false
verifier:
name: testinfra
lint:
name: flake8

@ -0,0 +1,26 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Converge
hosts: all
roles:
- role: tripleo-hieradata
hieradata_template: "{{ playbook_dir }}/mock-hieradata.j2.yaml"
hieradata_per_host: true
hieradata_files:
- node
- common

@ -0,0 +1,21 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Prepare
hosts: all
roles:
- role: test_deps

@ -0,0 +1,29 @@
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import json
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hieradata_files(host):
assert host.file("/etc/puppet/hieradata/extraconfig.json").exists
assert host.file("/etc/puppet/hieradata/service_configs.json").exists

@ -0,0 +1,24 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Copy hieradata files
copy:
dest: /etc/puppet/hieradata/{{ item.key }}.json
mode: 0600
content: "{{ item.value }}"
loop: "{{ hieradata_content['datafiles'] | default({}) | dict2items }}"
loop_control:
label: "{{ item.key }}"

@ -0,0 +1,21 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Render hieradata from template
template:
src: templates/{{ item }}.j2
dest: "{{ dest_path | default('/etc/puppet/hieradata/' ~ item ~ '.json') }}"
loop: "{{ hieradata_templates_list }}"

@ -0,0 +1,74 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Create /etc/puppet/hieradata
file:
path: /etc/puppet/hieradata
state: directory
mode: 0700
- name: Write hiera config
when:
- (hieradata_files | length) > 0
copy:
mode: 0600
dest: /etc/puppet/hiera.yaml
# TODO(emilien) Switch to Hiera5 format once we stop calling Hiera CLI
# which is deprecated and should be replaced by "puppet lookup" command.
content: |
---
:backends:
- json
:json:
:datadir: /etc/puppet/hieradata
:hierarchy:
{{ hieradata_files }}
- name: hieradata block
run_once: true
block:
- name: Create temporary file
tempfile:
state: file
suffix: temp
register: tempfile_1
changed_when: false
notify:
- Cleanup temp file
- name: Template hieradata file
template:
src: "{{ hieradata_template }}"
dest: "{{ tempfile_1.path }}"
variable_start_string: "{{ hieradata_variable_start_string }}"
variable_end_string: "{{ hieradata_variable_end_string }}"
changed_when: false
when:
- (hieradata_template | string)
notify:
- Cleanup temp file
- name: Read temp file
slurp:
src: "{{ tempfile_1.path }}"
register: tempfile_1_slurp
changed_when: false
notify:
- Cleanup temp file
- include_tasks: "{{ (hieradata_per_host | bool) | ternary('per_host.yml', 'all_hosts.yml') }}"
vars:
hieradata_content: "{{ tempfile_1_slurp['content'] | b64decode | from_yaml }}"

@ -0,0 +1,22 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Copy hieradata for host {{ inventory_hostname }}
copy:
dest: "/etc/puppet/hieradata/{{ item }}.json"
mode: 0600
content: "{{ hieradata_content[inventory_hostname]['datafiles'][item] }}"
loop: "{{ hieradata_content[inventory_hostname]['datafiles'] | list }}"

@ -0,0 +1,42 @@
{% set all_nodes = {} %}
{% set _ = all_nodes.__setitem__('enabled_services', (enabled_services | unique)) %}
{% for service in enabled_services %}
{# <service>_enabled: true #}
{% set _ = all_nodes.__setitem__((service ~ '_enabled'), true) %}
{# <service>_node_ips: <list of ips> #}
{% set _ = all_nodes.__setitem__((service ~ '_node_ips'), (groups[service] | default ([]) | map('extract', hostvars, service_net_map[service ~ '_network'] | default('ctlplane') ~ '_ip') | list)) %}
{% if nova_additional_cell %}
{# <service>_cell_node_names: <list of hostnames> #}
{% set _ = all_nodes.__setitem__((service ~ '_cell_node_names'), (groups[service] | default ([]) | map('extract', hostvars, service_net_map[service ~ '_network'] | default('ctlplane') ~ '_hostname') | list)) %}
{% else %}
{# <service>_node_names: <list of hostnames> #}
{% set _ = all_nodes.__setitem__((service ~ '_node_names'), (groups[service] | default ([]) | map('extract', hostvars, service_net_map[service ~ '_network'] | default('ctlplane') ~ '_hostname') | list)) %}
{% endif %}
{# <service>_short_node_names: <list of hostnames> #}
{% set _ = all_nodes.__setitem__((service ~ '_short_node_names'), (groups[service] | default ([]) | map('extract', hostvars, 'inventory_hostname') | list)) %}
{# <service>_short_bootstrap_node_name: hostname #}
{% set services = (groups[service] | default ([]) | map('extract', hostvars, 'inventory_hostname')) | list %}
{% if (services | length) > 0 %}
{% set _ = all_nodes.__setitem__((service ~ '_short_bootstrap_node_name'), (services | first)) %}
{% endif %}
{# <service>_bootstrap_node_ip: hostname #}
{% set services = (groups[service] | default ([]) | map('extract', hostvars, service_net_map[service ~ '_network'] | default('ctlplane') ~ '_ip')) | list %}
{% if (services | length) > 0 %}
{% set _ = all_nodes.__setitem__((service ~ '_bootstrap_node_ip'), (services | first)) %}
{% endif %}
{% endfor %}
{# <service>_network: <network> #}
{% for key, value in service_net_map.items() %}
{% set _ = all_nodes.__setitem__(key, value) %}
{% endfor %}
{% if 'redis' in enabled_services %}
{% set _ = all_nodes.__setitem__('redis_vip', (net_vip_map.redis)) %}
{% endif %}
{% set _ = all_nodes.__setitem__('deploy_identifier', deploy_identifier) %}
{% set _ = all_nodes.__setitem__('stack_action', stack_action) %}
{% set _ = all_nodes.__setitem__('stack_update_type', stack_update_type) %}
{% set _ = all_nodes.__setitem__('container_cli', container_cli) %}
{% set _ = all_nodes.__setitem__('controller_node_ips', (groups[primary_role_name] | default([]) | map('extract', hostvars, 'ctlplane_ip') | list | join(','))) %}
{% set _ = all_nodes.__setitem__('controller_node_names', (groups[primary_role_name] | default([]) | map('extract', hostvars, 'inventory_hostname') | list | join(','))) %}
{# RENDER #}
{{ all_nodes | to_nice_json }}

@ -0,0 +1,4 @@
{% set boostrap_node = {} %}
{% set _ = boostrap_node.__setitem__('boostrap_node_id', bootstrap_nodeid) %}
{# RENDER #}
{{ boostrap_node | to_nice_json }}

@ -0,0 +1,4 @@
{% set cloud_domain_data = {} %}
{% set _ = cloud_domain_data.__setitem__('tripleo::clouddomain', cloud_domain) %}
{# RENDER #}
{{ cloud_domain_data | to_nice_json }}

@ -0,0 +1 @@
{{ extraconfig | default({}) | to_nice_json }}

@ -0,0 +1,12 @@
{% set fqdn = {} %}
{% set _ = fqdn.__setitem__('fqdn_ctlplane', (inventory_hostname ~ '.ctlplane.' ~ cloud_domain)) %}
{% set _ = fqdn.__setitem__('fqdn_canonical', (inventory_hostname ~ '.' ~ cloud_domain)) %}
{% if role_networks %}
{% for network in enabled_networks %}
{% if network in role_networks %}
{% set _ = fqdn.__setitem__(('fqdn_' ~ networks[network]['name_lower']), (inventory_hostname ~ '.' ~ network | lower ~ '.' ~ cloud_domain)) %}
{% endif %}
{% endfor %}
{% endif %}
{# RENDER #}
{{ fqdn | to_nice_json }}

@ -0,0 +1,18 @@
{% set net_ip_map = {} %}
{% set _ = net_ip_map.__setitem__('ctlplane', ctlplane_ip) %}
{% set _ = net_ip_map.__setitem__('ctlplane_subnet', ctlplane_ip ~ '/' ~ ctlplane_subnet_cidr) %}
{% set _ = net_ip_map.__setitem__('ctlplane_uri', (ctlplane_ip | ipwrap)) %}
{% for network in enabled_networks %}
{% if network_cidrs and ((network ~ '_cidr') in network_cidrs) %}
{% set _ = net_ip_map.__setitem__(networks[network]['name'], (hostvars[inventory_hostname][networks[network]['name'] ~ '_ip'])) %}
{% set _ = net_ip_map.__setitem__((networks[network]['name'] ~ '_subnet'), (hostvars[inventory_hostname][networks[network]['name'] ~ '_ip'] ~ '/' ~ network_cidrs[network ~ '_cidr'])) %}
{% set _ = net_ip_map.__setitem__((networks[network]['name'] ~ '_uri'), (hostvars[inventory_hostname][networks[network]['name'] ~ '_ip'] | ipwrap)) %}
{% else %}
{# just add empty entries for this network if it doesn't apply to this role. matches previous behavior from Heat #}
{% set _ = net_ip_map.__setitem__(networks[network]['name'], "") %}
{% set _ = net_ip_map.__setitem__((networks[network]['name'] ~ '_subnet'), "") %}
{% set _ = net_ip_map.__setitem__((networks[network]['name'] ~ '_uri'), "") %}
{% endif %}
{% endfor %}
{# RENDER #}
{{ net_ip_map | to_nice_json }}

@ -0,0 +1 @@
{{ role_extraconfig | default({}) | to_nice_json }}

@ -0,0 +1 @@
{{ service_configs | default({}) | to_nice_json }}

@ -0,0 +1,45 @@
{% set vip_data = {} %}
{% set _ = vip_data.__setitem__('controller_virtual_ip', control_virtual_ip) %}
{% set _ = vip_data.__setitem__('keystone_admin_api_vip', (net_vip_map[service_net_map['keystone_admin_api_network']])) %}
{% set _ = vip_data.__setitem__('keystone_public_api_vip', (net_vip_map[service_net_map['keystone_public_api_network']])) %}
{% if 'External' in enabled_networks %}
{% set _ = vip_data.__setitem__('public_virtual_ip', (net_vip_map[networks['External']['name_lower']])) %}
{% else %}
{% set _ = vip_data.__setitem__('public_virtual_ip', (net_vip_map.ctlplane)) %}
{% endif %}
{% if 'InternalApi' in enabled_networks %}
{# the internal_api_virtual_ip is needed for contrail only #}
{% set _ = vip_data.__setitem__('internal_api_virtual_ip', (net_vip_map[networks['InternalApi']['name_lower']])) %}
{% endif %}
{% set _ = vip_data.__setitem__('network_virtual_ips', network_virtual_ips) %}
{% for network in enabled_networks %}
{% if network == 'StorageNFS' %}
{% set _ = vip_data.__setitem__('ganesha_vip', (net_vip_map[storagenfs_net_name])) %}
{% endif %}
{% endfor %}
{# public_virtual_ip and controller_virtual_ip are needed in both HAproxy & keepalived. #}
{% if 'External' in enabled_networks %}
{% set _ = vip_data.__setitem__('tripleo::haproxy::public_virtual_ip', (net_vip_map[networks['External']['name_lower']])) %}
{% set _ = vip_data.__setitem__('tripleo::keepalived::public_virtual_ip', (net_vip_map[networks['External']['name_lower']])) %}
{% else %}
{% set _ = vip_data.__setitem__('tripleo::haproxy::public_virtual_ip', (net_vip_map.ctlplane)) %}
{% set _ = vip_data.__setitem__('tripleo::keepalived::public_virtual_ip', (net_vip_map.ctlplane)) %}
{% endif %}
{% set _ = vip_data.__setitem__('tripleo::haproxy::controller_virtual_ip', (net_vip_map.ctlplane)) %}
{% set _ = vip_data.__setitem__('tripleo::keepalived::controller_virtual_ip', (net_vip_map.ctlplane)) %}
{% set _ = vip_data.__setitem__('tripleo::keepalived::redis_virtual_ip', (net_vip_map.redis)) %}
{% set _ = vip_data.__setitem__('tripleo::redis_notification::haproxy_monitor_ip', (net_vip_map.ctlplane)) %}
{% for key, value in cloud_names.items() %}
{% set _ = vip_data.__setitem__(key, value) %}
{% endfor %}
{% set _ = vip_data.__setitem__('enable_internal_tls', (enable_internal_tls | lower | bool)) %}
{% for service in enabled_services %}
{% if service_net_map.get(service ~ '_network', 'noop') in net_vip_map %}
{# we set explicit vips for these services, no need to calculate them dynamically #}
{% if service not in ['redis', 'ganesha', 'keystone_admin_api_vip', 'keystone_public_api_vip'] %}
{% set _ = vip_data.__setitem__((service ~ '_vip'), (net_vip_map[service_net_map[service ~ '_network']])) %}
{% endif %}
{% endif %}
{% endfor %}
{# RENDER #}
{{ vip_data | to_nice_json }}

@ -0,0 +1,17 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
tripleo_upgrade_hiera_file: /etc/puppet/hieradata/upgrade.json

@ -0,0 +1,44 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
galaxy_info:
author: OpenStack
description: TripleO OpenStack Role -- tripleo-upgrade-hiera
company: Red Hat
license: Apache-2.0
min_ansible_version: 2.7
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: Fedora
versions:
- 28
- name: CentOS
versions:
- 7
galaxy_tags:
- tripleo
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []

@ -0,0 +1,37 @@
# Molecule managed
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi
{% for pkg in item.easy_install | default([]) %}
# install pip for centos where there is no python-pip rpm in default repos
RUN easy_install {{ pkg }}
{% endfor %}
CMD ["sh", "-c", "while true; do sleep 10000; done"]

@ -0,0 +1,48 @@
---
driver:
name: docker
log: true
platforms:
- name: centos7
hostname: centos7
image: centos:7
dockerfile: Dockerfile