Merge "Use service tenant for ceilometer"
[apex-tripleo-heat-templates.git] / extraconfig / pre_deploy / rhel-registration / rhel-registration.yaml
1 heat_template_version: 2014-10-16
2
3 description: >
4   RHEL Registration and unregistration software deployments.
5
6 # Note extra parameters can be defined, then passed data via the
7 # environment parameter_defaults, without modifying the parent template
8 parameters:
9   server:
10     type: string
11   # To be defined via a local or global environment in parameter_defaults
12   rhel_reg_activation_key:
13     type: string
14   rhel_reg_auto_attach:
15     type: string
16   rhel_reg_base_url:
17     type: string
18   rhel_reg_environment:
19     type: string
20   rhel_reg_force:
21     type: string
22   rhel_reg_machine_name:
23     type: string
24   rhel_reg_org:
25     type: string
26   rhel_reg_password:
27     type: string
28   rhel_reg_pool_id:
29     type: string
30   rhel_reg_release:
31     type: string
32   rhel_reg_repos:
33     type: string
34   rhel_reg_sat_url:
35     type: string
36   rhel_reg_server_url:
37     type: string
38   rhel_reg_service_level:
39     type: string
40   rhel_reg_user:
41     type: string
42   rhel_reg_type:
43     type: string
44   rhel_reg_method:
45     type: string
46
47 resources:
48
49   RHELRegistration:
50     type: OS::Heat::SoftwareConfig
51     properties:
52       group: script
53       inputs:
54         - name: REG_ACTIVATION_KEY
55         - name: REG_AUTO_ATTACH
56         - name: REG_BASE_URL
57         - name: REG_ENVIRONMENT
58         - name: REG_FORCE
59         - name: REG_MACHINE_NAME
60         - name: REG_ORG
61         - name: REG_PASSWORD
62         - name: REG_POOL_ID
63         - name: REG_RELEASE
64         - name: REG_REPOS
65         - name: REG_SAT_URL
66         - name: REG_SERVER_URL
67         - name: REG_SERVICE_LEVEL
68         - name: REG_USER
69         - name: REG_TYPE
70         - name: REG_METHOD
71       config: {get_file: scripts/rhel-registration}
72
73   RHELRegistrationDeployment:
74     type: OS::Heat::SoftwareDeployment
75     properties:
76       name: RHELRegistrationDeployment
77       server:  {get_param: server}
78       config: {get_resource: RHELRegistration}
79       actions: ['CREATE'] # Only do this on CREATE
80       input_values:
81         REG_ACTIVATION_KEY: {get_param: rhel_reg_activation_key}
82         REG_AUTO_ATTACH: {get_param: rhel_reg_auto_attach}
83         REG_BASE_URL: {get_param: rhel_reg_base_url}
84         REG_ENVIRONMENT: {get_param: rhel_reg_environment}
85         REG_FORCE: {get_param: rhel_reg_force}
86         REG_MACHINE_NAME: {get_param: rhel_reg_machine_name}
87         REG_ORG: {get_param: rhel_reg_org}
88         REG_PASSWORD: {get_param: rhel_reg_password}
89         REG_POOL_ID: {get_param: rhel_reg_pool_id}
90         REG_RELEASE: {get_param: rhel_reg_release}
91         REG_REPOS: {get_param: rhel_reg_repos}
92         REG_SAT_URL: {get_param: rhel_reg_sat_url}
93         REG_SERVER_URL: {get_param: rhel_reg_server_url}
94         REG_SERVICE_LEVEL: {get_param: rhel_reg_service_level}
95         REG_USER: {get_param: rhel_reg_user}
96         REG_TYPE: {get_param: rhel_reg_type}
97         REG_METHOD: {get_param: rhel_reg_method}
98
99   RHELUnregistration:
100     type: OS::Heat::SoftwareConfig
101     properties:
102       group: script
103       config: {get_file: scripts/rhel-unregistration}
104       inputs:
105         - name: REG_METHOD
106
107   RHELUnregistrationDeployment:
108     type: OS::Heat::SoftwareDeployment
109     properties:
110       name: RHELUnregistrationDeployment
111       server:  {get_param: server}
112       config: {get_resource: RHELUnregistration}
113       actions: ['DELETE'] # Only do this on DELETE
114       input_values:
115         REG_METHOD: {get_param: rhel_reg_method}
116
117 outputs:
118   deploy_stdout:
119     description: Deployment reference, used to trigger puppet apply on changes
120     value: {get_attr: [RHELRegistrationDeployment, deploy_stdout]}
121