I just have finished some test related to how to use the --environment-directory option.
### STEP 1 ### Reproducing the issue
[stack@instack ~]$ cd
[stack@instack ~]$ pwd
/home/stack
# Creating a temp folder to move an env file
[stack@instack ~]$ mkdir kk
[stack@instack ~]$ cp tripleo-heat-templates/environments/puppet-pacemaker.yaml kk/
# We will deploy puppet-pacemaker.yaml inside the templates folder
[stack@instack ~]$ openstack overcloud deploy --libvirt-type qemu --ntp-server pool.ntp.org --templates /home/stack/tripleo-heat-templates --environment-directory /home/stack/kk/ --debug
The thing here is that rabbitmq.yaml is referenced using a relative path in puppet-pacemaker.yaml, relative to the --templates folder.
i.e.
OS::TripleO::Services::RabbitMQ: ../puppet/services/pacemaker/rabbitmq.yaml
A quick workaround might be to update the path to the templates in your `kk` folder.
# Now if you want to use the --environment-directory let's move a few env files to the `kk` folder.
The env. files that we are going to use does not have any dependency with any other file.
[stack@instack kk]$ ls
config-debug.yaml debug.yaml use-dns-for-vips.yaml
parameters:
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
TimeZone:
default: 'UTC'
description: The timezone to be set on the overcloud.
type: string
outputs:
role_data:
description: Timezone role using composable services.
value: service_name: timezone config_settings:
timezone::timezone: {get_param: TimeZone}
step_config: |
include ::timezone
Environment directory: /home/stack/kk/
Environment directory file: /home/stack/kk/custom_timezone.yaml
Processing environment files [u'/home/stack/kk/custom_timezone.yaml', u'/home/stack/tripleo-heat-templates/overcloud-resource-registry-puppet.yaml', u'/home/stack/tripleo-heat-templates/environments/puppet-pacemaker.yaml']
Processing environment files /home/stack/kk/custom_timezone.yaml
Adding files {u'file:///home/stack/kk/services/timezone.yaml': '{"outputs": {"role_data": {"description": "Timezone role using composable services.", "value": {"service_name": "timezone", "step_config": "include ::timezone", "config_settings": {"timezone::timezone": {"get_param": "TimeZone"}}}}}, "heat_template_version": "2016-04-08", "description": "Composable Timezone service\\n", "parameters": {"TimeZone": {"default": "UTC", "type": "string", "description": "The timezone to be set on the overcloud."}, "DefaultPasswords": {"default": {}, "type": "json"}, "EndpointMap": {"default": {}, "type": "json", "description": "Mapping of service endpoint -> protocol. Typically set via parameter_defaults in the resource registry."}, "ServiceNetMap": {"default": {}, "type": "json", "description": "Mapping of service_name -> network name. Typically set via parameter_defaults in the resource registry. This mapping overrides those in ServiceNetMapDefaults."}}}'} for /home/stack/kk/custom_timezone.yaml
# Note:
# Take into account that when using --environment-directory it's not recursing into the subfolders.
Hey,
I just have finished some test related to how to use the --environment- directory option.
### STEP 1 ### Reproducing the issue
[stack@instack ~]$ cd
[stack@instack ~]$ pwd
/home/stack
# Creating a temp folder to move an env file heat-templates/ environments/ puppet- pacemaker. yaml kk/
[stack@instack ~]$ mkdir kk
[stack@instack ~]$ cp tripleo-
# We will deploy puppet- pacemaker. yaml inside the templates folder tripleo- heat-templates --environment- directory /home/stack/kk/ --debug
[stack@instack ~]$ openstack overcloud deploy --libvirt-type qemu --ntp-server pool.ntp.org --templates /home/stack/
# You have the error described in the bug.
Environment directory: kk/ pacemaker. yaml stack/overcloud -env.json' , u'kk/puppet- pacemaker. yaml'] overcloud- env.json pacemaker. yaml /home/stack/ puppet/ services/ pacemaker/ rabbitmq. yaml processing environment file kk/puppet- pacemaker. yaml
Environment directory file: kk/puppet-
Processing environment files ['/home/
Processing environment files /home/stack/
Processing environment files kk/puppet-
Error Could not fetch contents for file://
### STEP 2 ### Checking some behaviour
The thing here is that rabbitmq.yaml is referenced using a relative path in puppet- pacemaker. yaml, relative to the --templates folder. :Services: :RabbitMQ: ../puppet/ services/ pacemaker/ rabbitmq. yaml
i.e.
OS::TripleO:
A quick workaround might be to update the path to the templates in your `kk` folder.
resource_registry: :ControllerConf ig: /home/stack/ tripleo- heat-templates/ puppet/ controller- config- pacemaker. yaml :Tasks: :ControllerPreP uppet: /home/stack/ tripleo- heat-templates/ extraconfig/ tasks/pre_ puppet_ pacemaker. yaml :Tasks: :ControllerPost Puppet: /home/stack/ tripleo- heat-templates/ extraconfig/ tasks/post_ puppet_ pacemaker. yaml :Tasks: :ControllerPost PuppetRestart: /home/stack/ tripleo- heat-templates/ extraconfig/ tasks/post_ puppet_ pacemaker_ restart. yaml :Services: :CinderVolume: /home/stack/ tripleo- heat-templates/ puppet/ services/ pacemaker/ cinder- volume. yaml :Services: :RabbitMQ: /home/stack/ tripleo- heat-templates/ puppet/ services/ pacemaker/ rabbitmq. yaml :Services: :HAproxy: /home/stack/ tripleo- heat-templates/ puppet/ services/ pacemaker/ haproxy. yaml :Services: :Pacemaker: /home/stack/ tripleo- heat-templates/ puppet/ services/ pacemaker. yaml :Services: :Redis: /home/stack/ tripleo- heat-templates/ puppet/ services/ pacemaker/ database/ redis.yaml :Services: :MySQL: /home/stack/ tripleo- heat-templates/ puppet/ services/ pacemaker/ database/ mysql.yaml
OS::TripleO:
OS::TripleO:
OS::TripleO:
OS::TripleO:
OS::TripleO:
OS::TripleO:
OS::TripleO:
OS::TripleO:
OS::TripleO:
OS::TripleO:
# Try to re-deploy. tripleo- heat-templates --environment- directory /home/stack/kk/ --debug
[stack@instack ~]$ openstack overcloud deploy --libvirt-type qemu --ntp-server pool.ntp.org --templates /home/stack/
As you can see the templates were found (We just hard wired the path)
Deploying templates in the directory /tmp/tripleocli ent-CZhMjc/ tripleo- heat-templates kk/puppet- pacemaker. yaml stack/kk/ puppet- pacemaker. yaml'] kk/puppet- pacemaker. yaml ///home/ stack/tripleo- heat-templates/ puppet/ services/ pacemaker/ haproxy. yaml': '{"outputs": {"role_data": {"description": "Role data for the HAproxy with pacemaker role.", "value": {"service_name": "haproxy", "step_config": "include ::tripleo: :profile: :pacemaker: :haproxy" , "config_settings": {"map_merge": [{"get_attr": ["LoadbalancerS erviceBase" , "role_data", "config_ settings" ]}, {"trip.....
Creating Environment file
Environment directory: /home/stack/kk/
Environment directory file: /home/stack/
Processing environment files [u'/home/
Processing environment files /home/stack/
Adding files {u'file:
# Ideally, those env. files should be referenced with the -e option if you are not going to modify them i.e.
openstack overcloud deploy \ tripleo- heat-templates \ tripleo- heat-templates/ overcloud- resource- registry- puppet. yaml \ tripleo- heat-templates/ environments/ puppet- pacemaker. yaml
--libvirt-type qemu \
--ntp-server pool.ntp.org \
--templates /home/stack/
-e /home/stack/
-e /home/stack/
# Now if you want to use the --environment- directory let's move a few env files to the `kk` folder.
The env. files that we are going to use does not have any dependency with any other file.
[stack@instack kk]$ ls for-vips. yaml
config-debug.yaml debug.yaml use-dns-
# And redeploy with.
openstack overcloud deploy \ tripleo- heat-templates \ tripleo- heat-templates/ overcloud- resource- registry- puppet. yaml \ tripleo- heat-templates/ environments/ puppet- pacemaker. yaml \ directory /home/stack/kk/ \
--libvirt-type qemu \
--ntp-server pool.ntp.org \
--templates /home/stack/
-e /home/stack/
-e /home/stack/
--environment-
--debug
# Those env. files were loaded correctly.
Creating Environment file kk/config- debug.yaml kk/debug. yaml kk/use- dns-for- vips.yaml stack/kk/ config- debug.yaml' , u'/home/ stack/kk/ debug.yaml' , u'/home/ stack/kk/ use-dns- for-vips. yaml', u'/home/ stack/tripleo- heat-templates/ overcloud- resource- registry- puppet. yaml', u'/home/ stack/tripleo- heat-templates/ environments/ puppet- pacemaker. yaml'] kk/config- debug.yaml kk/debug. yaml kk/use- dns-for- vips.yaml tripleo- heat-templates/ overcloud- resource- registry- puppet. yaml tripleo- heat-templates/ overclo. .....
Environment directory: /home/stack/kk/
Environment directory file: /home/stack/
Environment directory file: /home/stack/
Environment directory file: /home/stack/
Processing environment files [u'/home/
Processing environment files /home/stack/
Processing environment files /home/stack/
Processing environment files /home/stack/
Processing environment files /home/stack/
Redirecting env file /home/stack/
# Now let's try with some env files updating the resource registry. timezone. yaml and services/ timezone. yaml:
Create inside `kk` custom_
custom_ timezone. yaml with:
resource_registry: TripleO: :Services: :Timezone: ./services/ timezone. yaml
OS::
services/ timezone. yaml with:
heat_template_ version: 2016-04-08
description: >
Composable Timezone service
parameters: faults. ords:
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDe
type: json
DefaultPassw
default: {}
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
TimeZone:
default: 'UTC'
description: The timezone to be set on the overcloud.
type: string
outputs:
service_ name: timezone
config_ settings: :timezone: {get_param: TimeZone}
role_data:
description: Timezone role using composable services.
value:
timezone:
step_config: |
include ::timezone
# And redeploy with..
openstack overcloud deploy \ tripleo- heat-templates \ tripleo- heat-templates/ overcloud- resource- registry- puppet. yaml \ tripleo- heat-templates/ environments/ puppet- pacemaker. yaml \ directory /home/stack/kk/ \
--libvirt-type qemu \
--ntp-server pool.ntp.org \
--templates /home/stack/
-e /home/stack/
-e /home/stack/
--environment-
--debug
# This will load your files correctly
Environment directory: /home/stack/kk/ kk/custom_ timezone. yaml stack/kk/ custom_ timezone. yaml', u'/home/ stack/tripleo- heat-templates/ overcloud- resource- registry- puppet. yaml', u'/home/ stack/tripleo- heat-templates/ environments/ puppet- pacemaker. yaml'] kk/custom_ timezone. yaml ///home/ stack/kk/ services/ timezone. yaml': '{"outputs": {"role_data": {"description": "Timezone role using composable services.", "value": {"service_name": "timezone", "step_config": "include ::timezone", "config_settings": {"timezone: :timezone" : {"get_param": "TimeZone"}}}}}, "heat_template_ version" : "2016-04-08", "description": "Composable Timezone service\\n", "parameters": {"TimeZone": {"default": "UTC", "type": "string", "description": "The timezone to be set on the overcloud."}, "DefaultPasswords": {"default": {}, "type": "json"}, "EndpointMap": {"default": {}, "type": "json", "description": "Mapping of service endpoint -> protocol. Typically set via parameter_defaults in the resource registry."}, "ServiceNetMap": {"default": {}, "type": "json", "description": "Mapping of service_name -> network name. Typically set via parameter_defaults in the resource registry. This mapping overrides those in ServiceNetMapDe faults. "}}}'} for /home/stack/ kk/custom_ timezone. yaml
Environment directory file: /home/stack/
Processing environment files [u'/home/
Processing environment files /home/stack/
Adding files {u'file:
# Note: directory it's not recursing into the subfolders.
# Take into account that when using --environment-