aboutsummaryrefslogtreecommitdiffstats
path: root/puppet/upgrade_config.yaml
blob: 499160e554dfc5a60c9109b0e52c73886f461168 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
heat_template_version: ocata
description: 'Upgrade for via ansible by applying a step related tag'

parameters:
  UpgradeStepConfig:
     type: json
     description: Config (ansible yaml) that will be used to step through the deployment.
     default: ''

  step:
    type: string
    description: Step number of the upgrade

resources:

  AnsibleConfig:
    type: OS::Heat::Value
    properties:
      value:
        str_replace:
          template: CONFIG
          params:
            CONFIG:
              - hosts: localhost
                connection: local
                tasks: {get_param: UpgradeStepConfig}

  AnsibleUpgradeConfigImpl:
    type: OS::Heat::SoftwareConfig
    properties:
      group: ansible
      options:
        tags:
          str_replace:
            template: "stepSTEP"
            params:
              STEP: {get_param: step}
      inputs:
      - name: role
      config: {get_attr: [AnsibleConfig, value]}

outputs:
  OS::stack_id:
    description: The software config which runs ansible with tags
    value: {get_resource: AnsibleUpgradeConfigImpl}
  upgrade_config:
    description:  The configuration file used for upgrade
    value: {get_attr: [AnsibleConfig, value]}