Enable cockpit, initially Fedora 33 with others later
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| Role Name | Role Name | ||||||
| ========= | ========= | ||||||
|  |  | ||||||
| A brief description of the role goes here. | Ensures cockpit is running | ||||||
|  |  | ||||||
| Requirements | Requirements | ||||||
| ------------ | ------------ | ||||||
| @@ -30,7 +30,7 @@ Including an example of how to use your role (for instance, with variables passe | |||||||
| License | License | ||||||
| ------- | ------- | ||||||
|  |  | ||||||
| BSD | LGPL-3.0-or-later | ||||||
|  |  | ||||||
| Author Information | Author Information | ||||||
| ------------------ | ------------------ | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| galaxy_info: | galaxy_info: | ||||||
|   author: your name |   author: Jason Rothstein | ||||||
|   description: your role description |   description: Ensures cockpit is installed, running, and functional | ||||||
|   company: your company (optional) |   company: your company (optional) | ||||||
|  |  | ||||||
|   # If the issue tracker for your role is not on github, uncomment the |   # If the issue tracker for your role is not on github, uncomment the | ||||||
| @@ -14,7 +14,7 @@ galaxy_info: | |||||||
|   # - GPL-3.0-only |   # - GPL-3.0-only | ||||||
|   # - Apache-2.0 |   # - Apache-2.0 | ||||||
|   # - CC-BY-4.0 |   # - CC-BY-4.0 | ||||||
|   license: license (GPL-2.0-or-later, MIT, etc) |   license: LGPL-3.0-or-later | ||||||
|  |  | ||||||
|   min_ansible_version: 2.9 |   min_ansible_version: 2.9 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,2 +1,61 @@ | |||||||
| --- | --- | ||||||
| # tasks file for ensure_cockpit | # tasks file for ensure_cockpit | ||||||
|  | - name: 'include variables' | ||||||
|  |   when: | ||||||
|  |     - ansible_system == 'Linux' | ||||||
|  |   include_vars: | ||||||
|  |     file: '{{ lookup("first_found", findme ) }}' | ||||||
|  |     name: 'ensure_cockpit' | ||||||
|  |   vars: | ||||||
|  |     findme: | ||||||
|  |       files: | ||||||
|  |         - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' | ||||||
|  |         - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml' | ||||||
|  |         - '{{ ansible_distribution }}-default.yml' | ||||||
|  |         - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' | ||||||
|  |         - '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml' | ||||||
|  |         - '{{ ansible_os_family }}-default.yml' | ||||||
|  |         - 'default.yml' | ||||||
|  |       paths: | ||||||
|  |         - '../vars/' | ||||||
|  |       errors: 'ignore' | ||||||
|  | - name: 'package discovery' | ||||||
|  |   when: | ||||||
|  |     - ansible_system == 'Linux' | ||||||
|  |     - packages is not defined | ||||||
|  |   ansible.builtin.package_facts: | ||||||
|  | - name: 'ensure packages' | ||||||
|  |   when: | ||||||
|  |     - ansible_system == 'Linux' | ||||||
|  |     - ensure_cockpit is defined | ||||||
|  |     - ensure_cockpit.package_list is defined | ||||||
|  |     - ensure_cockpit.package_list is iterable | ||||||
|  |     - packages[item.name] is not defined | ||||||
|  |   ansible.builtin.package: | ||||||
|  |     name: '{{ item.name }}' | ||||||
|  |     state: '{{ item.state }}' | ||||||
|  |   loop: '{{ ensure_cockpit.package_list }}' | ||||||
|  |   loop_control: | ||||||
|  |     label: '{{ item.name }} will be {{ item.state }}' | ||||||
|  |   notify: | ||||||
|  |     - 'ensure_cockpit.package_facts' | ||||||
|  |     - 'ensure_cockpit.service_facts' | ||||||
|  | - name: 'ensure services' | ||||||
|  |   when: | ||||||
|  |     - ansible_system == 'Linux' | ||||||
|  |     - ensure_cockpit is defined | ||||||
|  |     - ensure_cockpit.service_list is defined | ||||||
|  |     - ensure_cockpit.service_list is iterable | ||||||
|  |   ansible.builtin.service: | ||||||
|  |     enabled: '{{ item.enabled }}' | ||||||
|  |     name: '{{ item.name }}' | ||||||
|  |     state: '{{ item.state }}' | ||||||
|  |   loop: '{{ ensure_cockpit.service_list }}' | ||||||
|  |   loop_control: | ||||||
|  |     label: '{{ item.name }} will be {{ item.state }}' | ||||||
|  |   notify: | ||||||
|  |     - 'ensure_cockpit.package_facts' | ||||||
|  |     - 'ensure_cockpit.service_facts' | ||||||
|  | - name: 'flush handlers' | ||||||
|  |   meta: 'flush_handlers' | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										32
									
								
								vars/Fedora-33.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								vars/Fedora-33.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | |||||||
|  | --- | ||||||
|  | # vars file for ensure_cockpit | ||||||
|  | package_list: | ||||||
|  |   - name: 'cockpit' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-bridge' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-dashboard' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-doc' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-kdump' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-networkmanager' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-packagekit' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-pcp' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-selinux' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-storaged' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-system' | ||||||
|  |     state: 'present' | ||||||
|  |   - name: 'cockpit-ws' | ||||||
|  |     state: 'present' | ||||||
|  | service_list: | ||||||
|  |   - name: 'cockpit.socket' | ||||||
|  |     state: 'started' | ||||||
|  |     enabled: 'yes' | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								vars/default.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								vars/default.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | |||||||
|  | --- | ||||||
|  | # vars file for ensure_cockpit | ||||||
		Reference in New Issue
	
	Block a user