summaryrefslogtreecommitdiff
path: root/hot/software-config/boot-config/templates/install_config_agent_test_image.yaml
blob: 752e76b5e1326d0a47a394c402bb78f0b82cdbcc (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
heat_template_version: 2014-10-16

parameters:
  pip_mirror:
    type: string
    default: https://pypi.python.org/simple

resources:

  install_config_agent_pip:
    type: "OS::Heat::SoftwareConfig"
    properties:
      group: ungrouped
      config:
        str_replace:
          params:
            $pip_mirror: {get_param: pip_mirror}
          template: |
            #!/bin/bash
            set -eux

            pip freeze

            pip install --index-url "$pip_mirror" --pre --no-deps os-collect-config os-apply-config os-refresh-config dib-utils heat-cfntools
            pip freeze
            cfn-create-aws-symlinks --force

  configure_config_agent:
    type: "OS::Heat::SoftwareConfig"
    properties:
      group: ungrouped
      config:
        str_replace:
          params:
            $heat_config_script: {get_file: ../../elements/heat-config/os-refresh-config/configure.d/55-heat-config}
            $hook_script: {get_file: ../../elements/heat-config-script/install.d/hook-script.py}
            $heat_config_notify: {get_file: ../../elements/heat-config/bin/heat-config-notify}
            $occ_conf: {get_file: fragments/os-collect-config.conf}
            $orc_oac: {get_file: fragments/20-os-apply-config}
          template: {get_file: fragments/configure_config_agent.sh}

  install_puppet_hook:
    type: "OS::Heat::CloudConfig"
    properties:
      cloud_config:
        merge_how: dict(recurse_array)+list(append)
        write_files:
          - path: /var/lib/heat-config/hooks/puppet
            owner: "root:root"
            permissions: "0755"
            content: {get_file: ../../elements/heat-config-puppet/install.d/hook-puppet.py}

  install_cfn_init_hook:
    type: "OS::Heat::CloudConfig"
    properties:
      cloud_config:
        merge_how: dict(recurse_array)+list(append)
        write_files:
          - path: /var/lib/heat-config/hooks/cfn-init
            owner: "root:root"
            permissions: "0755"
            content: {get_file: ../../elements/heat-config-cfn-init/install.d/hook-cfn-init.py}

  start_config_agent:
    type: "OS::Heat::SoftwareConfig"
    properties:
      group: ungrouped
      config: {get_file: fragments/start_config_agent.sh}

  install_config_agent:
    type: "OS::Heat::MultipartMime"
    properties:
      parts:
      - config: {get_resource: install_config_agent_pip}
      - config: {get_resource: configure_config_agent}
      - config: {get_resource: install_puppet_hook}
      - config: {get_resource: install_cfn_init_hook}
      - config: {get_resource: start_config_agent}

outputs:
  config:
    value: {get_resource: install_config_agent}