fdf2e957efa5d097ddaff123ddae19c281516a9e
[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
49 resources:
50
51   RHELRegistration:
52     type: OS::Heat::SoftwareConfig
53     properties:
54       group: script
55       inputs:
56         - name: REG_ACTIVATION_KEY
57         - name: REG_AUTO_ATTACH
58         - name: REG_BASE_URL
59         - name: REG_ENVIRONMENT
60         - name: REG_FORCE
61         - name: REG_MACHINE_NAME
62         - name: REG_ORG
63         - name: REG_PASSWORD
64         - name: REG_POOL_ID
65         - name: REG_RELEASE
66         - name: REG_REPOS
67         - name: REG_SAT_URL
68         - name: REG_SERVER_URL
69         - name: REG_SERVICE_LEVEL
70         - name: REG_USER
71         - name: REG_TYPE
72         - name: REG_METHOD
73         - name: REG_SAT_REPO
74       config: {get_file: scripts/rhel-registration}
75
76   RHELRegistrationDeployment:
77     type: OS::Heat::SoftwareDeployment
78     properties:
79       name: RHELRegistrationDeployment
80       server:  {get_param: server}
81       config: {get_resource: RHELRegistration}
82       actions: ['CREATE'] # Only do this on CREATE
83       input_values:
84         REG_ACTIVATION_KEY: {get_param: rhel_reg_activation_key}
85         REG_AUTO_ATTACH: {get_param: rhel_reg_auto_attach}
86         REG_BASE_URL: {get_param: rhel_reg_base_url}
87         REG_ENVIRONMENT: {get_param: rhel_reg_environment}
88         REG_FORCE: {get_param: rhel_reg_force}
89         REG_MACHINE_NAME: {get_param: rhel_reg_machine_name}
90         REG_ORG: {get_param: rhel_reg_org}
91         REG_PASSWORD: {get_param: rhel_reg_password}
92         REG_POOL_ID: {get_param: rhel_reg_pool_id}
93         REG_RELEASE: {get_param: rhel_reg_release}
94         REG_REPOS: {get_param: rhel_reg_repos}
95         REG_SAT_URL: {get_param: rhel_reg_sat_url}
96         REG_SERVER_URL: {get_param: rhel_reg_server_url}
97         REG_SERVICE_LEVEL: {get_param: rhel_reg_service_level}
98         REG_USER: {get_param: rhel_reg_user}
99         REG_TYPE: {get_param: rhel_reg_type}
100         REG_METHOD: {get_param: rhel_reg_method}
101         REG_SAT_REPO: {get_param: rhel_reg_sat_repo}
102
103   RHELUnregistration:
104     type: OS::Heat::SoftwareConfig
105     properties:
106       group: script
107       config: {get_file: scripts/rhel-unregistration}
108       inputs:
109         - name: REG_METHOD
110
111   RHELUnregistrationDeployment:
112     type: OS::Heat::SoftwareDeployment
113     properties:
114       name: RHELUnregistrationDeployment
115       server:  {get_param: server}
116       config: {get_resource: RHELUnregistration}
117       actions: ['DELETE'] # Only do this on DELETE
118       input_values:
119         REG_METHOD: {get_param: rhel_reg_method}
120
121 outputs:
122   deploy_stdout:
123     description: Deployment reference, used to trigger puppet apply on changes
124     value: {get_attr: [RHELRegistrationDeployment, deploy_stdout]}
125