diff --git a/cloud-init/user-data b/cloud-init/user-data index 92e221f972b8a0a00b579aa1315033768690d4a6..897d60ad7c603ec6330f4c0bde01830d1ff3a20e 100644 --- a/cloud-init/user-data +++ b/cloud-init/user-data @@ -7,7 +7,7 @@ autoinstall: ethernets: eno1: addresses: - - 137.224.8.121/24 + - 137.224.8.120/24 nameservers: search: [wur.nl, wurnet.nl] addresses: [10.90.3.31, 10.90.7.14, 10.91.3.31] @@ -16,13 +16,13 @@ autoinstall: via: 137.224.8.254 eno2: addresses: - - 192.168.5.253/24 + - 192.168.5.254/24 eno3: addresses: - - 192.168.0.253/24 + - 192.168.0.254/24 eno4: addresses: - - 192.168.1.253/24 + - 192.168.1.254/24 storage: grub: @@ -174,7 +174,7 @@ autoinstall: preserve: false user-data: - hostname: master0.anunna.wur.nl + hostname: master1.anunna.wur.nl disable_root: false runcmd: - update-grub diff --git a/cloud-init/user-data.default b/cloud-init/user-data.default new file mode 100644 index 0000000000000000000000000000000000000000..be924bccfe87b1be69c7775768ebb151dce72b3d --- /dev/null +++ b/cloud-init/user-data.default @@ -0,0 +1,264 @@ +#cloud-config +autoinstall: + version: 1 + + network: + version: 2 + ethernets: + eno1: + addresses: + - 10.90.10.8/25 + nameservers: + search: [wur.nl, wurnet.nl] + addresses: [10.90.3.31, 10.90.7.14, 10.91.3.31] + routes: + - to: default + via: 10.90.10.1 + + storage: + grub: + reorder_uefi: False + config: + - id: disk0 + type: disk + ptable: gpt + preserve: false + + - id: disk0-efi + type: partition + number: 1 + size: 512MB + device: disk0 + flag: boot + grub_device: true + preserve: false + - id: disk0-efi-fs + type: format + fstype: fat32 + volume: disk0-efi + preserve: false + - id: disk0-efi-mount + type: mount + path: /boot/efi + device: disk0-efi-fs + preserve: false + + - id: disk0-boot + type: partition + number: 2 + size: 4GB + device: disk0 + preserve: false + - id: disk0-boot-fs + type: format + fstype: ext4 + volume: disk0-boot + preserve: false + - id: disk0-boot-mount + type: mount + path: /boot + device: disk0-boot-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: disk0-pv + type: partition + number: 3 + size: -1 + device: disk0 + preserve: false + - id: Vsys + type: lvm_volgroup + name: Vsys + devices: + - disk0-pv + preserve: false + + - id: Vsys-Lroot + type: lvm_partition + name: Lroot + size: 5G + volgroup: Vsys + preserve: false + - id: Vsys-Lroot-fs + type: format + fstype: ext4 + volume: Vsys-Lroot + preserve: false + - id: Vsys-Lroot-mount + type: mount + path: / + device: Vsys-Lroot-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Lvar + type: lvm_partition + name: Lvar + size: 4G + volgroup: Vsys + preserve: false + - id: Vsys-Lvar-fs + type: format + fstype: ext4 + volume: Vsys-Lvar + preserve: false + - id: Vsys-Lvar-mount + type: mount + path: /var + device: Vsys-Lvar-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Llog + type: lvm_partition + name: Llog + size: 8G + volgroup: Vsys + preserve: false + - id: Vsys-Llog-fs + type: format + fstype: ext4 + volume: Vsys-Llog + preserve: false + - id: Vsys-Llog-mount + type: mount + path: /var/log + device: Vsys-Llog-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Lhome + type: lvm_partition + name: Lhome + size: 4G + volgroup: Vsys + preserve: false + - id: Vsys-Lhome-fs + type: format + fstype: ext4 + volume: Vsys-Lhome + preserve: false + - id: Vsys-Lhome-mount + type: mount + path: /home + device: Vsys-Lhome-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Lopt + type: lvm_partition + name: Lopt + size: -1 + volgroup: Vsys + preserve: false + - id: Vsys-Lopt-fs + type: format + fstype: ext4 + volume: Vsys-Lopt + preserve: false + - id: Vsys-Lopt-mount + type: mount + path: /opt + device: Vsys-Lopt-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + user-data: + hostname: aesir-master0 + disable_root: false + runcmd: + - update-grub + users: [] + + packages: + - apt-transport-https + - apt-utils + - ansible + - curl + - dos2unix + - git + - gpg + - jnettop + - joe + - keyutils + - krb5-user + - ldap-utils + - ldapscripts + - libpam-krb5 + - libpam-mount + - libssl-dev + - lvm2 + - mailutils + - mc + - nano + - net-tools + - ntfs-3g + - nscd + - nslcd + - ntp + - ntpdate + - open-vm-tools + - openssh-server + - pv + - pwgen + - python3 + - python3-pip + - samba + - screen + - smbclient + - ssl-cert + - sssd + - sssd-ad + - sssd-common + - sssd-krb5 + - sssd-ldap + - samba-common + - samba-common-bin + - telnet + - tree + - unzip + - vim + - wget + - xxd + - zip +#HPC specific + - apache2 + - bind9 + - build-essential + - cifs-utils + - corosync + - debootstrap + - fakeroot + - freeipmi + - nfs-common + - nfs-kernel-server + - open-iscsi + - pcs + - pxelinux + - quilt + - rsync + - slapd + - syslinux + + late-commands: +#Set initial root password + - sed -i 's|^root:[^:]*:|root:$ROOT_CRYPT:|' /target/etc/shadow +#Install temporary PMP API key + deploy git repo (secrets) +#2021.03.17: PMP Key updated. Key is valid until 2022.03.16. Key name in PMP: "Scomp1343 Ansible/AWX en PMP koppeling" + - mkdir -p /target/etc/ansible/facts.d + - echo '[pmp]\nkey=$PMP_KEY' > /target/etc/ansible/facts.d/rollout.fact + - git clone --single-branch https://gitlab+deploy-token-$DEPLOY_KEY@git.wur.nl/MDT-Managed-Server/ansible /target/root/ansible +#Set up scripts +# - echo -e '#!/bin/sh\nSTATUS=$(systemctl is-failed rollout-finish)\nif [ "${STATUS}" = "failed" ]; then\n echo "The rollout finalisation on \"$(hostname)\" has status FAILED!\nOutput of systemd:\n\n $(systemctl status rollout-finish)" | mail -s "The rollout finalisation on \"$(hostname)\" has status FAILED!" linux.beheer@wur.nl\nelse\n echo "The rollout finalisation on \"$(hostname)\" has status COMPLETED!\n\nHave a nice day!" | mail -s "The rollout finalisation on \"$(hostname)\" has status COMPLETED!" linux.beheer@wur.nl\n exit 1\nfi' > /target/root/ansible-rollout.sh + - echo -e '[Unit]\nDescription=Finish rollout\nAfter=network.target\n\n[Service]\nExecStart=/bin/sh -c "cd /root/ansible && ansible-playbook --connection=local -i127.0.0.1, -l127.0.0.1 playbooks/linux/rollout/ubuntu/20.04/rollout.yml"\nExecStart=/bin/sleep 300\nExecStart=/bin/sh /root/ansible-rollout.sh\nExecStart=/bin/rm /etc/ansible/facts.d/rollout.fact\nExecStart=/bin/rm -rf /root/ansible\nExecStart=-/bin/rm /etc/systemd/system/multi-user.target.wants/rollout-finish.service\nExecStart=-/bin/rm /etc/systemd/system/rollout-finish.service\nExecStart=-/bin/rm /root/ansible-rollout.sh\nExecStart=-/bin/systemctl daemon-reload\nEnvironment=ANSIBLE_CONFIG=/root/ansible/playbooks/linux/rollout/ubuntu/18.04/ansible.cfg\nType=oneshot\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\nEOF' > /target/etc/systemd/system/rollout-finish.service + - ln -s /etc/systemd/system/rollout-finish.service /target/etc/systemd/system/multi-user.target.wants/rollout-finish.service + + timezone: Europe/Amsterdam + + power_state: + delay: "now" + mode: reboot + message: Install completed. Rebooting now. + timeout: 30 + condition: True diff --git a/cloud-init/user-data.master0 b/cloud-init/user-data.master0 new file mode 100644 index 0000000000000000000000000000000000000000..92e221f972b8a0a00b579aa1315033768690d4a6 --- /dev/null +++ b/cloud-init/user-data.master0 @@ -0,0 +1,267 @@ +#cloud-config +autoinstall: + version: 1 + + network: + version: 2 + ethernets: + eno1: + addresses: + - 137.224.8.121/24 + nameservers: + search: [wur.nl, wurnet.nl] + addresses: [10.90.3.31, 10.90.7.14, 10.91.3.31] + routes: + - to: default + via: 137.224.8.254 + eno2: + addresses: + - 192.168.5.253/24 + eno3: + addresses: + - 192.168.0.253/24 + eno4: + addresses: + - 192.168.1.253/24 + + storage: + grub: + reorder_uefi: False + config: + - id: disk0 + type: disk + ptable: gpt + preserve: false + + - id: disk0-efi + type: partition + number: 1 + size: 512MB + device: disk0 + flag: boot + grub_device: true + preserve: false + - id: disk0-efi-fs + type: format + fstype: fat32 + volume: disk0-efi + preserve: false + - id: disk0-efi-mount + type: mount + path: /boot/efi + device: disk0-efi-fs + preserve: false + + - id: disk0-boot + type: partition + number: 2 + size: 4GB + device: disk0 + preserve: false + - id: disk0-boot-fs + type: format + fstype: ext4 + volume: disk0-boot + preserve: false + - id: disk0-boot-mount + type: mount + path: /boot + device: disk0-boot-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: disk0-pv + type: partition + number: 3 + size: -1 + device: disk0 + preserve: false + - id: Vsys + type: lvm_volgroup + name: Vsys + devices: + - disk0-pv + preserve: false + + - id: Vsys-Lroot + type: lvm_partition + name: Lroot + size: 30GB + volgroup: Vsys + preserve: false + - id: Vsys-Lroot-fs + type: format + fstype: ext4 + volume: Vsys-Lroot + preserve: false + - id: Vsys-Lroot-mount + type: mount + path: / + device: Vsys-Lroot-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Llog + type: lvm_partition + name: Llog + size: 10GB + volgroup: Vsys + preserve: false + - id: Vsys-Llog-fs + type: format + fstype: ext4 + volume: Vsys-Llog + preserve: false + - id: Vsys-Llog-mount + type: mount + path: /var/log + device: Vsys-Llog-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Lopt + type: lvm_partition + name: Lopt + size: 30GB + volgroup: Vsys + preserve: false + - id: Vsys-Lopt-fs + type: format + fstype: ext4 + volume: Vsys-Lopt + preserve: false + - id: Vsys-Lopt-mount + type: mount + path: /opt + device: Vsys-Lopt-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Limages + type: lvm_partition + name: Limages + size: 200GB + volgroup: Vsys + preserve: false + - id: Vsys-Limages-fs + type: format + fstype: ext4 + volume: Vsys-Limages + preserve: false + - id: Vsys-Limages-mount + type: mount + path: /images + device: Vsys-Limages-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Lmysql + type: lvm_partition + name: Lmysql + size: 150GB + volgroup: Vsys + preserve: false + - id: Vsys-Lmysql-fs + type: format + fstype: ext4 + volume: Vsys-Lmysql + preserve: false + - id: Vsys-Lmysql-mount + type: mount + path: /var/lib/mysql + device: Vsys-Lmysql-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + user-data: + hostname: master0.anunna.wur.nl + disable_root: false + runcmd: + - update-grub + users: [] + + packages: + - apt-transport-https + - apt-utils + - ansible + - curl + - dos2unix + - git + - gpg + - jnettop + - joe + - keyutils + - krb5-user + - ldap-utils + - ldapscripts + - libpam-krb5 + - libpam-mount + - libssl-dev + - lvm2 + - mailutils + - mc + - nano + - net-tools + - ntfs-3g + - nscd + - nslcd + - ntp + - ntpdate + - open-vm-tools + - openssh-server + - pv + - pwgen + - python3 + - python-is-python3 + - python3-pip + - samba + - screen + - smbclient + - ssl-cert + - sssd + - sssd-ad + - sssd-common + - sssd-krb5 + - sssd-ldap + - samba-common + - samba-common-bin + - telnet + - tree + - unzip + - vim + - wget + - xxd + - zip +#HPC specific + - apache2 + - bind9 + - build-essential + - cifs-utils + - corosync + - debootstrap + - fakeroot + - freeipmi + - nfs-common + - nfs-kernel-server + - open-iscsi + - pcs + - pxelinux + - quilt + - rsync + - slapd + - syslinux + + late-commands: + - sed -i 's|^root:[^:]*:|root:$ROOT_CRYPT:|' /target/etc/shadow + - git clone --single-branch https://gitlab+deploy-token-$DEPLOY_KEY@git.wur.nl/hpcag-admin/sali-custom /target/root/sali-custom +# - echo '[Unit]\nDescription=Finish HPC rollout\nAfter=network.target\n\n[Service]\nExecStart=/bin/sh -c "cd /root/sali-custom/ansible && ansible-playbook --connection=local -i127.0.0.1, -l127.0.0.1 single-install.yml"\n\nExecStart=-/bin/rm /etc/systemd/system/multi-user.target.wants/rollout-finish.service\nExecStart=-/bin/rm /etc/systemd/system/rollout-finish.service\nExecStart=-/bin/rm /root/ansible-rollout.sh\nExecStart=-/bin/systemctl daemon-reload\n\nType=oneshot\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target' > /target/etc/systemd/system/rollout-finish.service +# - ln -s /etc/systemd/system/rollout-finish.service /target/etc/systemd/system/multi-user.target.wants/rollout-finish.service + + timezone: Europe/Amsterdam + + power_state: + delay: "now" + mode: reboot + message: Install completed. Rebooting now. + timeout: 30 + condition: True diff --git a/cloud-init/user-data.master1 b/cloud-init/user-data.master1 new file mode 100644 index 0000000000000000000000000000000000000000..897d60ad7c603ec6330f4c0bde01830d1ff3a20e --- /dev/null +++ b/cloud-init/user-data.master1 @@ -0,0 +1,267 @@ +#cloud-config +autoinstall: + version: 1 + + network: + version: 2 + ethernets: + eno1: + addresses: + - 137.224.8.120/24 + nameservers: + search: [wur.nl, wurnet.nl] + addresses: [10.90.3.31, 10.90.7.14, 10.91.3.31] + routes: + - to: default + via: 137.224.8.254 + eno2: + addresses: + - 192.168.5.254/24 + eno3: + addresses: + - 192.168.0.254/24 + eno4: + addresses: + - 192.168.1.254/24 + + storage: + grub: + reorder_uefi: False + config: + - id: disk0 + type: disk + ptable: gpt + preserve: false + + - id: disk0-efi + type: partition + number: 1 + size: 512MB + device: disk0 + flag: boot + grub_device: true + preserve: false + - id: disk0-efi-fs + type: format + fstype: fat32 + volume: disk0-efi + preserve: false + - id: disk0-efi-mount + type: mount + path: /boot/efi + device: disk0-efi-fs + preserve: false + + - id: disk0-boot + type: partition + number: 2 + size: 4GB + device: disk0 + preserve: false + - id: disk0-boot-fs + type: format + fstype: ext4 + volume: disk0-boot + preserve: false + - id: disk0-boot-mount + type: mount + path: /boot + device: disk0-boot-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: disk0-pv + type: partition + number: 3 + size: -1 + device: disk0 + preserve: false + - id: Vsys + type: lvm_volgroup + name: Vsys + devices: + - disk0-pv + preserve: false + + - id: Vsys-Lroot + type: lvm_partition + name: Lroot + size: 30GB + volgroup: Vsys + preserve: false + - id: Vsys-Lroot-fs + type: format + fstype: ext4 + volume: Vsys-Lroot + preserve: false + - id: Vsys-Lroot-mount + type: mount + path: / + device: Vsys-Lroot-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Llog + type: lvm_partition + name: Llog + size: 10GB + volgroup: Vsys + preserve: false + - id: Vsys-Llog-fs + type: format + fstype: ext4 + volume: Vsys-Llog + preserve: false + - id: Vsys-Llog-mount + type: mount + path: /var/log + device: Vsys-Llog-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Lopt + type: lvm_partition + name: Lopt + size: 30GB + volgroup: Vsys + preserve: false + - id: Vsys-Lopt-fs + type: format + fstype: ext4 + volume: Vsys-Lopt + preserve: false + - id: Vsys-Lopt-mount + type: mount + path: /opt + device: Vsys-Lopt-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Limages + type: lvm_partition + name: Limages + size: 200GB + volgroup: Vsys + preserve: false + - id: Vsys-Limages-fs + type: format + fstype: ext4 + volume: Vsys-Limages + preserve: false + - id: Vsys-Limages-mount + type: mount + path: /images + device: Vsys-Limages-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + - id: Vsys-Lmysql + type: lvm_partition + name: Lmysql + size: 150GB + volgroup: Vsys + preserve: false + - id: Vsys-Lmysql-fs + type: format + fstype: ext4 + volume: Vsys-Lmysql + preserve: false + - id: Vsys-Lmysql-mount + type: mount + path: /var/lib/mysql + device: Vsys-Lmysql-fs + options: 'defaults,noatime,discard,errors=remount-ro' + preserve: false + + user-data: + hostname: master1.anunna.wur.nl + disable_root: false + runcmd: + - update-grub + users: [] + + packages: + - apt-transport-https + - apt-utils + - ansible + - curl + - dos2unix + - git + - gpg + - jnettop + - joe + - keyutils + - krb5-user + - ldap-utils + - ldapscripts + - libpam-krb5 + - libpam-mount + - libssl-dev + - lvm2 + - mailutils + - mc + - nano + - net-tools + - ntfs-3g + - nscd + - nslcd + - ntp + - ntpdate + - open-vm-tools + - openssh-server + - pv + - pwgen + - python3 + - python-is-python3 + - python3-pip + - samba + - screen + - smbclient + - ssl-cert + - sssd + - sssd-ad + - sssd-common + - sssd-krb5 + - sssd-ldap + - samba-common + - samba-common-bin + - telnet + - tree + - unzip + - vim + - wget + - xxd + - zip +#HPC specific + - apache2 + - bind9 + - build-essential + - cifs-utils + - corosync + - debootstrap + - fakeroot + - freeipmi + - nfs-common + - nfs-kernel-server + - open-iscsi + - pcs + - pxelinux + - quilt + - rsync + - slapd + - syslinux + + late-commands: + - sed -i 's|^root:[^:]*:|root:$ROOT_CRYPT:|' /target/etc/shadow + - git clone --single-branch https://gitlab+deploy-token-$DEPLOY_KEY@git.wur.nl/hpcag-admin/sali-custom /target/root/sali-custom +# - echo '[Unit]\nDescription=Finish HPC rollout\nAfter=network.target\n\n[Service]\nExecStart=/bin/sh -c "cd /root/sali-custom/ansible && ansible-playbook --connection=local -i127.0.0.1, -l127.0.0.1 single-install.yml"\n\nExecStart=-/bin/rm /etc/systemd/system/multi-user.target.wants/rollout-finish.service\nExecStart=-/bin/rm /etc/systemd/system/rollout-finish.service\nExecStart=-/bin/rm /root/ansible-rollout.sh\nExecStart=-/bin/systemctl daemon-reload\n\nType=oneshot\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target' > /target/etc/systemd/system/rollout-finish.service +# - ln -s /etc/systemd/system/rollout-finish.service /target/etc/systemd/system/multi-user.target.wants/rollout-finish.service + + timezone: Europe/Amsterdam + + power_state: + delay: "now" + mode: reboot + message: Install completed. Rebooting now. + timeout: 30 + condition: True