Merge "Sort ResourceGroup resource list"
[apex-tripleo-heat-templates.git] / extraconfig / pre_deploy / rhel-registration / rhel-registration.yaml
1 heat_template_version: ocata
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   rhel_reg_sat_repo:
47     type: string
48   rhel_reg_http_proxy_host:
49     type: string
50   rhel_reg_http_proxy_port:
51     type: string
52   rhel_reg_http_proxy_username:
53     type: string
54   rhel_reg_http_proxy_password:
55     type: string
56
57 resources:
58
59   RHELRegistration:
60     type: OS::Heat::SoftwareConfig
61     properties:
62       group: script
63       inputs:
64         - name: REG_ACTIVATION_KEY
65         - name: REG_AUTO_ATTACH
66         - name: REG_BASE_URL
67         - name: REG_ENVIRONMENT
68         - name: REG_FORCE
69         - name: REG_MACHINE_NAME
70         - name: REG_ORG
71         - name: REG_PASSWORD
72         - name: REG_POOL_ID
73         - name: REG_RELEASE
74         - name: REG_REPOS
75         - name: REG_SAT_URL
76         - name: REG_SERVER_URL
77         - name: REG_SERVICE_LEVEL
78         - name: REG_USER
79         - name: REG_TYPE
80         - name: REG_METHOD
81         - name: REG_SAT_REPO
82         - name: REG_HTTP_PROXY_HOST
83         - name: REG_HTTP_PROXY_PORT
84         - name: REG_HTTP_PROXY_USERNAME
85         - name: REG_HTTP_PROXY_PASSWORD
86       config: {get_file: scripts/rhel-registration}
87
88   RHELRegistrationDeployment:
89     type: OS::Heat::SoftwareDeployment
90     properties:
91       name: RHELRegistrationDeployment
92       server:  {get_param: server}
93       config: {get_resource: RHELRegistration}
94       actions: ['CREATE'] # Only do this on CREATE
95       input_values:
96         REG_ACTIVATION_KEY: {get_param: rhel_reg_activation_key}
97         REG_AUTO_ATTACH: {get_param: rhel_reg_auto_attach}
98         REG_BASE_URL: {get_param: rhel_reg_base_url}
99         REG_ENVIRONMENT: {get_param: rhel_reg_environment}
100         REG_FORCE: {get_param: rhel_reg_force}
101         REG_MACHINE_NAME: {get_param: rhel_reg_machine_name}
102         REG_ORG: {get_param: rhel_reg_org}
103         REG_PASSWORD: {get_param: rhel_reg_password}
104         REG_POOL_ID: {get_param: rhel_reg_pool_id}
105         REG_RELEASE: {get_param: rhel_reg_release}
106         REG_REPOS: {get_param: rhel_reg_repos}
107         REG_SAT_URL: {get_param: rhel_reg_sat_url}
108         REG_SERVER_URL: {get_param: rhel_reg_server_url}
109         REG_SERVICE_LEVEL: {get_param: rhel_reg_service_level}
110         REG_USER: {get_param: rhel_reg_user}
111         REG_TYPE: {get_param: rhel_reg_type}
112         REG_METHOD: {get_param: rhel_reg_method}
113         REG_SAT_REPO: {get_param: rhel_reg_sat_repo}
114         REG_HTTP_PROXY_HOST: {get_param: rhel_reg_http_proxy_host}
115         REG_HTTP_PROXY_PORT: {get_param: rhel_reg_http_proxy_port}
116         REG_HTTP_PROXY_USERNAME: {get_param: rhel_reg_http_proxy_username}
117         REG_HTTP_PROXY_PASSWORD: {get_param: rhel_reg_http_proxy_password}
118
119   RHELUnregistration:
120     type: OS::Heat::SoftwareConfig
121     properties:
122       group: script
123       config: {get_file: scripts/rhel-unregistration}
124       inputs:
125         - name: REG_METHOD
126
127   RHELUnregistrationDeployment:
128     type: OS::Heat::SoftwareDeployment
129     properties:
130       name: RHELUnregistrationDeployment
131       server:  {get_param: server}
132       config: {get_resource: RHELUnregistration}
133       actions: ['DELETE'] # Only do this on DELETE
134       input_values:
135         REG_METHOD: {get_param: rhel_reg_method}
136
137 outputs:
138   deploy_stdout:
139     description: Deployment reference, used to trigger puppet apply on changes
140     value: {get_attr: [RHELRegistrationDeployment, deploy_stdout]}
141