summaryrefslogtreecommitdiff
path: root/hot/software-config/example-templates/example-cloud-init-configure-ca-cert.yaml
blob: 3a4c78f859827c28ee4757a8faf6c5fab419afa5 (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
heat_template_version: newton
description: >
  This template demonstrates the different ways to configure
  an instance's trusted CA certificates when the instance boots
  for the first time.
parameters:
  key_name:
    type: string
  flavor:
    type: string
  image:
    type: string
    default: ubuntu-software-config

resources:
  the_sg:
    type: OS::Neutron::SecurityGroup
    properties:
      name: the_sg
      description: Ping and SSH
      rules:
      - protocol: icmp
      - protocol: tcp
        port_range_min: 22
        port_range_max: 22

  ca_1_init:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        ca-certs:
          trusted:
            - {get_file: certificates/ca_1.crt}

  ca_2_init:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        ca-certs:
          trusted:
            - {get_file: certificates/ca_2.crt}

  server_1_init:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: ca_1_init}

  server_one:
    type: OS::Nova::Server
    properties:
      image: {get_param: image}
      flavor: {get_param: flavor}
      key_name: {get_param: key_name}
      security_groups:
      - {get_resource: the_sg}
      user_data_format: SOFTWARE_CONFIG
      user_data:
        get_resource: server_1_init

  server_two:
    type: OS::Nova::Server
    properties:
      image: {get_param: image}
      flavor: {get_param: flavor}
      key_name: {get_param: key_name}
      security_groups:
      - {get_resource: the_sg}
      user_data_format: RAW
      user_data: {get_resource: ca_2_init}

  server_three:
    type: OS::Nova::Server
    properties:
      image: {get_param: image}
      flavor: {get_param: flavor}
      key_name: {get_param: key_name}
      security_groups:
      - {get_resource: the_sg}
      user_data_format: RAW
      user_data: {get_file: config-scripts/example-ca-certs-config.yml}