diff --git a/azhop_state.sh b/azhop_state.sh index c708a9cbc..45ce186f9 100755 --- a/azhop_state.sh +++ b/azhop_state.sh @@ -79,12 +79,15 @@ case $COMMAND in echo "Resource group is empty, exiting" exit 1 fi + BICEP_PARAMS=$RESOURCE_GROUP.parameters.json # Copy state files into the state directory mkdir -p $STATE_DIR cp $AZHOP_CONFIG $STATE_DIR ADMIN_USER=$(yq eval '.admin_user' $AZHOP_CONFIG) cp ${ADMIN_USER}_id_rsa $STATE_DIR cp ${ADMIN_USER}_id_rsa.pub $STATE_DIR + cp ${BICEP_PARAMS} $STATE_DIR + mkdir -p $STATE_DIR/packer cp packer/options.json $STATE_DIR/packer/options.json mkdir -p $STATE_DIR/playbooks/group_vars diff --git a/playbooks/roles/cyclecloud_cluster/projects/common/cluster-init/files/almalinux/init_joindomain.sh b/playbooks/roles/cyclecloud_cluster/projects/common/cluster-init/files/almalinux/init_joindomain.sh index 7951a136c..6f03f5bde 100644 --- a/playbooks/roles/cyclecloud_cluster/projects/common/cluster-init/files/almalinux/init_joindomain.sh +++ b/playbooks/roles/cyclecloud_cluster/projects/common/cluster-init/files/almalinux/init_joindomain.sh @@ -1,5 +1,5 @@ #!/bin/bash -packages="sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients policycoreutils-python-utils" +packages="sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients python3-policycoreutils" if ! rpm -q $packages; then echo "Installing packages $packages" diff --git a/playbooks/roles/domain_join/tasks/main.yml b/playbooks/roles/domain_join/tasks/main.yml index 1ac6d9707..55eb98b72 100644 --- a/playbooks/roles/domain_join/tasks/main.yml +++ b/playbooks/roles/domain_join/tasks/main.yml @@ -1,7 +1,22 @@ +--- +- name: Include distribution variables + block: + - name: Include distribution variables + ansible.builtin.include_vars: "{{ item }}" + with_first_found: + - "{{ ansible_distribution }}/{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_distribution }}.yml" + tags: [ 'always' ] + rescue: + - name: Change error message + ansible.builtin.fail: + msg: "unable to find anything in vars/ for this operating system! {{ ansible_distribution }}" + - name: Install dependencies yum: - name: epel-release, sssd, realmd, oddjob, oddjob-mkhomedir, adcli, samba-common, samba-common-tools, krb5-workstation, openldap-clients, policycoreutils-python, nfs-utils, python3 + name: '{{item}}' lock_timeout : 180 + loop: '{{domain_join_packages}}' notify: restart dbus - name: Disable SELinux diff --git a/playbooks/roles/domain_join/vars/AlmaLinux/8.yml b/playbooks/roles/domain_join/vars/AlmaLinux/8.yml new file mode 100644 index 000000000..c344beefc --- /dev/null +++ b/playbooks/roles/domain_join/vars/AlmaLinux/8.yml @@ -0,0 +1,14 @@ +domain_join_packages: + - epel-release + - sssd + - realmd + - oddjob + - oddjob-mkhomedir + - adcli + - samba-common + - samba-common-tools + - krb5-workstation + - openldap-clients + - python3-policycoreutils + - nfs-utils + - python3 \ No newline at end of file diff --git a/playbooks/roles/domain_join/vars/CentOS/7.yml b/playbooks/roles/domain_join/vars/CentOS/7.yml new file mode 100644 index 000000000..fde43484f --- /dev/null +++ b/playbooks/roles/domain_join/vars/CentOS/7.yml @@ -0,0 +1,14 @@ +domain_join_packages: + - epel-release + - sssd + - realmd + - oddjob + - oddjob-mkhomedir + - adcli + - samba-common + - samba-common-tools + - krb5-workstation + - openldap-clients + - policycoreutils-python + - nfs-utils + - python3 \ No newline at end of file