diff --git a/playbook/cvl2.yml b/playbook/cvl2.yml index 1a7fabfc2873a56c34896b408369978763d4760b..908e3af3416db7b0808a0b0b1535ecbc2fdc4d06 100644 --- a/playbook/cvl2.yml +++ b/playbook/cvl2.yml @@ -22,16 +22,16 @@ slurmctrl: "{{ groups['ManagementNodes'][0] }}" slurmqueues: - {name: batch, group: ComputeNodes, default: true} - - {name: dev, group: ComputeNodesDebug, default: false} + - {name: dev, group: ComputeNodesDev, default: false} - {name: multicore, group: ComputeNodesLarge, default: false} mkFileSystems: - - {fstype : 'ext4', dev: '/dev/vdc1', opts: '', name: '/scrach'} - - {fstype : 'ext4', dev: '/dev/vdc2', opts: '', name: '/cvl_home'} - - {fstype : 'ext4', dev: '/dev/vdc3', opts: '', name: '/usr/local'} - mntFileSystems: - - {fstype : 'ext4', dev: '/dev/vdc1', opts: 'defaults,nofail', name: '/scrach'} - - {fstype : 'ext4', dev: '/dev/vdc2', opts: 'defaults,nofail', name: '/cvl_home'} - - {fstype : 'ext4', dev: '/dev/vdc3', opts: 'defaults,nofail', name: '/usr/local'} + - {fstype : 'ext4', dev: '/dev/vdc1', opts: ''} + - {fstype : 'ext4', dev: '/dev/vdc2', opts: ''} + - {fstype : 'ext4', dev: '/dev/vdc3', opts: ''} + mountFileSystems: + - {fstype : 'ext4', dev: '/dev/vdc1', opts: 'defaults,nofail', name: '/cvl/scratch'} + - {fstype : 'ext4', dev: '/dev/vdc2', opts: 'defaults,nofail', name: '/cvl/home'} + - {fstype : 'ext4', dev: '/dev/vdc3', opts: 'defaults,nofail', name: '/cvl/local'} roles: - { role: easy-rsa-CA } - { role: OpenVPN-Server } @@ -41,12 +41,13 @@ - { role: nfs-server, configDiskDevice: true } - { role: slurm, slurm_use_vpn: true} - { role: installPackage, yumGroupPackageList: ['CVL Pre-installation', 'CVL Base Packages'], cliCopy: {'run': 'cp -r /usr/local/Modules/modulefiles/cvl /usr/local/Modules/modulefiles/massive', 'check': '/usr/local/Modules/modulefiles/massive'} } - tasks: - setup: - hosts: all vars_files: - massive_var/main.yml + vars: + x509_ca_server: "{{ groups['ManagementNodes'][0] }}" + openvpn_servers: "{{ groups['ManagementNodes'] }}" roles: - { role: etcHosts, domain: "{{ ldapDomain }}" } @@ -56,6 +57,7 @@ - massive_var/passwords.yml - massive_var/package.yml vars: + x509_ca_server: "{{ groups['ManagementNodes'][0] }}" openvpn_servers: "{{ groups['ManagementNodes'] }}" roles: - { role: OpenVPN-Client } @@ -66,6 +68,7 @@ - massive_var/passwords.yml - massive_var/package.yml vars: + x509_ca_server: "{{ groups['ManagementNodes'][0] }}" openvpn_servers: "{{ groups['ManagementNodes'] }}" roles: - { role: OpenVPN-Client } @@ -73,8 +76,24 @@ - hosts: all vars_files: - massive_var/main.yml + - massive_var/passwords.yml + - massive_var/package.yml + vars: + x509_ca_server: "{{ groups['ManagementNodes'][0] }}" + nfs_server: "{{ groups['ManagementNodes'][0] }}" + openvpn_servers: "{{ groups['ManagementNodes'] }}" + groupList: + - { name : 'ComputeNodes', interface : 'tun0' } + - { name : 'ComputeNodesDev', interface : 'tun0' } + - { name : 'ComputeNodesLarge', interface : 'tun0' } + - { name : 'LoginNodes', interface : 'tun0' } + exportList: + - { name: '/usr/local', src: '/cvl/local', fstype: 'nfs4', opts: 'defaults,ro,nofail', interface : 'tun0', srvopts: 'ro,sync' } + - { name: '/home', src: '/cvl/home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } + - { name: '/scratch', src: '/cvl/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } roles: - { role: etcHosts, domain: "{{ ldapDomain }}" } + - { role: syncExports } - hosts: 'ComputeNodes' vars_files: @@ -91,13 +110,12 @@ groupList: - { name : 'ComputeNodes', interface : 'tun0' } exportList: - - { name: '/usr/local', src: '/usr/local', fstype: 'nfs4', opts: 'defaults,ro,nofail', interface : 'tun0', srvopts: 'ro,fsid=0,sync' } - - { name: '/home', src: '/cvl_home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } - - { name: '/scratch', src: '/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } + - { name: '/usr/local', src: '/cvl/local', fstype: 'nfs4', opts: 'defaults,ro,nofail', interface : 'tun0', srvopts: 'ro,sync' } + - { name: '/home', src: '/cvl/home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } + - { name: '/scratch', src: '/cvl/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } roles: - { role: ntp } - { role: openLdapClient } - - { role: syncExports } - { role: nfs-client } - { role: slurm, slurm_use_vpn: true} - { role: installPackage, preInstallation: "umount /usr/local", postInstallation: "mount /usr/local", yumGroupPackageList: ["CVL Pre-installation", "CVL Base Packages"], cliFileCopy: {'src': '/tmp/gconf_path', 'dest': '/etc/gconf/2/path'} } @@ -112,17 +130,16 @@ openvpn_servers: "{{ groups['ManagementNodes'] }}" slurmctrl: "{{ groups['ManagementNodes'][0] }}" slurmqueues: - - {name: dev, group: ComputeNodesDebug, default: false} + - {name: dev, group: ComputeNodesDev, default: false} nfs_server: "{{ groups['ManagementNodes'][0] }}" groupList: - { name : 'ComputeNodes', interface : 'tun0' } exportList: - - { name: '/home', src: '/cvl_home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } - - { name: '/scratch', src: '/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } + - { name: '/home', src: '/cvl/home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } + - { name: '/scratch', src: '/cvl/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } roles: - { role: ntp } - { role: openLdapClient } - - { role: syncExports } - { role: nfs-client } - { role: slurm, slurm_use_vpn: true} - { role: installPackage, preInstallation: "umount /usr/local", postInstallation: "mount /usr/local", yumGroupPackageList: ["CVL Pre-installation", "CVL Base Packages"], cliFileCopy: {'src': '/tmp/gconf_path', 'dest': '/etc/gconf/2/path'} } @@ -142,13 +159,12 @@ groupList: - { name : 'ComputeNodes', interface : 'tun0' } exportList: - - { name: '/usr/local', src: '/usr/local', fstype: 'nfs4', opts: 'defaults,ro,nofail', interface : 'tun0', srvopts: 'ro,fsid=0,sync' } - - { name: '/home', src: '/cvl_home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } - - { name: '/scratch', src: '/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } + - { name: '/usr/local', src: '/cvl/local', fstype: 'nfs4', opts: 'defaults,ro,nofail', interface : 'tun0', srvopts: 'ro,sync' } + - { name: '/home', src: '/cvl/home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } + - { name: '/scratch', src: '/cvl/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } roles: - { role: ntp } - { role: openLdapClient } - - { role: syncExports } - { role: nfs-client } - { role: slurm, slurm_use_vpn: true} - { role: installPackage, preInstallation: "umount /usr/local", postInstallation: "mount /usr/local", yumGroupPackageList: ["CVL Pre-installation", "CVL Base Packages"], cliFileCopy: {'src': '/tmp/gconf_path', 'dest': '/etc/gconf/2/path'} } @@ -166,26 +182,11 @@ slurmqueues: - {name: batch, group: ComputeNodes, default: true} exportList: - - { name: '/home', src: '/cvl_home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } + - { name: '/home', src: '/cvl/home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,sync' } roles: - - { role: syncExports } -# - { role: OpenVPN-Client } - { role: ntp } - { role: openLdapClient } - { role: nfs-client } - { role: slurm, slurm_use_vpn: true} - { role: installPackage, importRepo: { command: "wget http://cvlrepo.massive.org.au/repo/cvl.repo -O", destination: "/etc/yum.repos.d/cvl.repo" }, yumGroupPackageList: ['CVL Pre-installation', 'CVL Base Packages'], cliCopy: {'run': 'cp -r /usr/local/Modules/modulefiles/cvl /usr/local/Modules/modulefiles/massive', 'check': '/usr/local/Modules/modulefiles/massive'} } -- hosts: "'ComputeNodes*' 'LoginNodes'" - vars_files: - - massive_var/main.yml - - massive_var/passwords.yml - - massive_var/package.yml - vars: - exportList: - - { name: '/usr/local', src: '/usr/local', fstype: 'nfs4', opts: 'defaults,ro,nofail', interface : 'tun0', srvopts: 'ro,fsid=0,sync' } - - { name: '/home', src: '/cvl_home', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } - - { name: '/scratch', src: '/scratch', fstype: 'nfs4', opts: 'defaults,nofail', interface : 'tun0', srvopts: 'rw,root_squash,fsid=0,sync' } - roles: - - { role: syncExports } - diff --git a/roles/easy-rsa-common/tasks/yumList.yml b/roles/easy-rsa-common/tasks/yumList.yml index fe7e95dea0716407b5be2c55f82cc9aa6b1bfe01..b3e4cb0d60bedb351090c75a0c3839079bd096bb 100644 --- a/roles/easy-rsa-common/tasks/yumList.yml +++ b/roles/easy-rsa-common/tasks/yumList.yml @@ -10,3 +10,4 @@ - openssl-devel - nfs-utils yum: "name={{ item }} state=present" + sudo: true diff --git a/roles/installPackage/tasks/main.yml b/roles/installPackage/tasks/main.yml index b3d91bdac1c537ffb1e50367e5e8eab198ba5c50..d8605ffc42082e877b9714363c88ce3182b57166 100644 --- a/roles/installPackage/tasks/main.yml +++ b/roles/installPackage/tasks/main.yml @@ -2,6 +2,7 @@ - name: Pre installation shell: "{{ preInstallation }}" sudo: true + ignore_errors: true when: ansible_distribution == 'CentOS' and preInstallation is defined - name: Add new repo file diff --git a/roles/nfs-client/tasks/mountFileSystem.yml b/roles/nfs-client/tasks/mountFileSystem.yml index 4a08034045c117019e6eb266e8d0cb67b3f3ec22..1f7a8d17fb2d31c5cb1e3a10d0cd6e1bfcaacaf5 100644 --- a/roles/nfs-client/tasks/mountFileSystem.yml +++ b/roles/nfs-client/tasks/mountFileSystem.yml @@ -1,9 +1,4 @@ --- -#- name: "Check mount" -# shell: mount | grep {{ item.name }} -# with_items: exportList -# register: result - - name: "stop fail2ban" service: name=fail2ban state=stopped sudo: true diff --git a/roles/nfs-server/tasks/mkFilesystem.yml b/roles/nfs-server/tasks/mkFilesystem.yml index 08904147978ca94d1d4f25be7cb1621be9e10607..b25a554d6960ca9736a1dcee46ec0d08276a9eff 100644 --- a/roles/nfs-server/tasks/mkFilesystem.yml +++ b/roles/nfs-server/tasks/mkFilesystem.yml @@ -3,11 +3,11 @@ filesystem: fstype={{ item.fstype }} dev={{ item.dev }} opts={{ item.opts }} with_items: mkFileSystems sudo: true - when: configDiskDevice or mkFileSystems is defined + when: mkFileSystems is defined - name: Mount device mount: name={{ item.name }} src={{ item.dev }} fstype={{ item.fstype }} opts={{ item.opts }} state=mounted with_items: mountFileSystems sudo: true - when: configDiskDevice or mountFileSystems is defined + when: mountFileSystems is defined diff --git a/roles/slurm/tasks/main.yml b/roles/slurm/tasks/main.yml index b14c7401b7b8460b4ec905ba795a02232d4a37de..8b7824c623cfd78ec2f1c44465b87ccabb62a2e6 100644 --- a/roles/slurm/tasks/main.yml +++ b/roles/slurm/tasks/main.yml @@ -20,7 +20,7 @@ sudo: true - name: create slurm user - user: name=slurm group=slurm system=yes + user: name=slurm group=slurm system=yes createhome=no sudo: true - name: install slurm rpms