Ondřej Ezr
2020-03-11 79b829fe8df1b087365841eaddcadd1e9e9932d6
commit | author | age
d1dc2b 1 :role: satellite-manage-lifecycle
MTM 2 :author: GPTE Team
3 :tag1: configure_satellite
4 :tag2: configure_satellite_lifecycle
5 :main_file: tasks/main.yml
79b829 6 :version_file: tasks/version_6.7.yml
d1dc2b 7
MTM 8
9 Role: {role}
10 ============
11
79b829 12 This role creates lifecycle environment path.
d1dc2b 13
MTM 14 Requirements
15 ------------
16
79b829 17 . Satellite must be install and setup.
d1dc2b 18
MTM 19 Role Variables
20 --------------
21
22 |===
23 |satellite_version: "Digit" |Required |satellite version
24 |org: "String" |Required |Organization name
79b829 25 |org_label: "String" |Optional | Organization label in string without space
OE 26 |org_description: "String" |Optional | Organization description
d1dc2b 27 |lifecycle_environment_path: [List] |Required | Contains nested list with dictinary keys and values
MTM 28 |name: "String" |Required |Name of environment
79b829 29 |label: "String" |Required |label of environment
d1dc2b 30 |descritpion: "String" |Required |Description for environment
MTM 31 |prior_env: "String" |Required |Name of the prior environment
32
33 |===
34
35 * Example variables
36
37 [source=text]
38 ----
79b829 39 satellite_version: 6.7
d1dc2b 40 org: "gpte"
MTM 41 org_label: "gpte"
42 org_description: "Global Partner Training and Enablement"
43 lifecycle_environment_path:
79b829 44   - name: "Development"
OE 45     label: "dev"
46     description: "Development Environment"
47     prior_env: "Library"
48   - name: "Staging"
49     label: "qa"
50     description: "Quality Environment"
51     prior_env: "Development"
52   - name: "Production"
53     label: "prod"
54     description: "Production Enviornment"
55     prior_env: "Staging"
d1dc2b 56 ----
MTM 57
58 Tags
59 ---
60
61 |===
62 |{tag1} |Consistent tag for all satellite config roles
63 |{tag2} | This tag is specific to this role only
64 |===
65
66 * Example tags
67
68 [source=text]
69 ----
70 ## Tagged jobs
79b829 71 ansible-playbook playbook.yml --tags configure_satellite,configure_satellite_lifecycle
d1dc2b 72
MTM 73 ## Skip tagged jobs
79b829 74 ansible-playbook playbook.yml --skip-tags configure_satellite_lifecycle
d1dc2b 75
MTM 76 ----
77
78
79 Example Playbook
80 ----------------
81
82 How to use your role (for instance, with variables passed in playbook).
83
84 [source=text]
85 ----
86 [user@desktop ~]$ cat sample_vars.yml
79b829 87 satellite_version: 6.7
d1dc2b 88 org: "gpte"
MTM 89 org_label: "gpte"
90 org_description: "Global Partner Training and Enablement"
91 lifecycle_environment_path:
79b829 92   - name: "Development"
OE 93     label: "dev"
94     description: "Development Environment"
95     prior_env: "Library"
96   - name: "Staging"
97     label: "qa"
98     description: "Quality Environment"
99     prior_env: "Development"
100   - name: "Production"
101     label: "prod"
102     description: "Production Enviornment"
103     prior_env: "Staging"
d1dc2b 104
MTM 105 [user@desktop ~]$ cat playbook.yml
106 - hosts: satellite.example.com
107   vars_files:
108     - sample_vars.yml
109   roles:
79b829 110     - satellite-manage-organization
d1dc2b 111
MTM 112 [user@desktop ~]$ ansible-playbook playbook.yml
113 ----
114
115 Tips to update Role
116 ------------------
117
79b829 118 To extend role works for other version, if needed create new file named  version_{{satellite_version}}.yml and import newly created file in main.yml
d1dc2b 119
79b829 120 for reference look at link:{main_file[main.yml] and link:{version_file}[version_6.x.yml]
d1dc2b 121
MTM 122
123 Author Information
124 ------------------
125
126 {author}