-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
61 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# dependencies: | ||
# - role: aybarsm.linux.package_manager | ||
# - role: aybarsm.linux.package_manager | ||
# - role: lae.proxmox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# The combination strategy below is highly nested hierarchy compliant and recommended (Example provided below) | ||
# proxmox__host > proxmox__group > proxmox__default | ||
proxmox__all: "{{ proxmox__default | combine(proxmox__group, proxmox__host, recursive=true, list_merge='replace') }}" | ||
|
||
__proxmox__purpose_packages: >- | ||
{%- set proxmox_repos = [] -%} | ||
{%- set proxmox_packages = [] -%} | ||
{%- set purpose_packages = [] -%} | ||
{%- if proxmox__manage_purpose_package_setup is defined and proxmox__manage_purpose_package_setup and proxmox__all.purposes is defined -%} | ||
{%- for purpose in proxmox__purpose_names -%} | ||
{%- for purpose_type in proxmox__purpose_types -%} | ||
{%- set host_config = proxmox__all.purposes[purpose] if purpose in proxmox__all.purposes else none -%} | ||
{%- set is_host_purpose = true if host_config else false -%} | ||
{%- set is_host_purpose_type = true if host_config and host_config.type is defined and host_config.type == purpose_type else false -%} | ||
{%- set host_purpose_version = host_config.version if host_config and host_config.version is defined else none -%} | ||
{%- set purpose_repo_state = 'present' if is_host_purpose and is_host_purpose_type else 'absent' -%} | ||
{%- set purpose_repo = proxmox__repo_url_enterprise if purpose_type == 'enterprise' else proxmox__repo_url_no_subscription -%} | ||
{%- if purpose in ['pve', 'pbs', 'pmg'] -%} | ||
{%- set proxmox_repos = proxmox_repos.append({ | ||
'type': 'repo', | ||
'repo': 'deb ' + purpose_repo + '/' + purpose + ' ' + ansible_distribution_release + ' ' + purpose + '-' + purpose_type, | ||
'filename': purpose + '-' + purpose_type, | ||
'state': purpose_repo_state | ||
}) -%} | ||
{%- if host_purpose_version and proxmox__purpose_packages[purpose] is defined and not purpose in purpose_packages -%} | ||
{%- set purpose_packages = purpose_packages.append(purpose) -%} | ||
{%- set package_name = proxmox__purpose_packages[purpose] if host_purpose_version == 'latest' else proxmox__purpose_packages[purpose] + '=' + host_purpose_version -%} | ||
{%- set package_state = 'latest' if host_purpose_version == 'latest' else 'present' -%} | ||
{%- set proxmox_packages = proxmox_packages.append({ | ||
'type': 'package', | ||
'name': package_name, | ||
'state': package_state | ||
}) -%} | ||
{%- endif -%} | ||
{%- elif purpose.startswith('ceph-') or purpose.startswith('ceph_') -%} | ||
{%- set proxmox_repos = proxmox_repos.append({ | ||
'type': 'repo', | ||
'repo': 'deb ' + purpose_repo + '/' + (purpose | replace('_', '-')) + ' ' + ansible_distribution_release + ' ' + purpose_type, | ||
'filename': 'ceph', | ||
'state': purpose_repo_state | ||
}) -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- endfor -%} | ||
{%- endif -%} | ||
{{ proxmox_repos + proxmox_packages }} |