/srv/saltstack/states/top.sls
:
'cs-tech1-vm.cs.uwaterloo.ca': # common.x == states/common/x.sls or x/init.sls # Install generic tools for non-LXC machines - common.physical # Config sshd for remote access and place keys - common.ssh # /etc/resolv.conf - common.networking.dns # Package caching - common.squid_deb_proxy.server # Use our own package cache - common.squid_deb_proxy.client # Static ifaces for cluster - common.networking.cluster_internal # sysctl net.ipv4.ip-forward = 1 # For shorewall NAT - common.networking.ip_forward # shorewall firewall for NAT # Third-party salt formula # included via gitfs configured in states/master.d/git_remotes.conf - shorewall # provides support for dnsmasq for dhcp, dns, pxe boot. - common.pxe
/srv/saltstack/pillar/top.sls
:
'cs-tech1-vm.cs.uwaterloo.ca': # Settings for head node only - cs-tech1-vm
# pillar/cs-tech1-vm/init.sls # Settings for head node include: # dnsmasq and pxe settings - cs-tech1-vm.pxe # cluster networking - cs-tech1-vm.net # export nfs shares - cs-tech1-vm.nfs # NAT - cs-tech1-vm.shorewall # ssh keys - cs-tech1-vm.ssh
# pillar/cabernet/init.sls # Settings for nodes, excluding head node include: # Turn on DHCP - cabernet.net # Mount nfs shares - cabernet.nfs # Allow head node's key - cabernet.ssh # eth0 interface naming - cabernet.grub
salt 'cs-tech1-vm*' state.apply --state-verbose=False test=True
salt 'cs-tech1-vm*' state.apply --state-verbose=False
common.pxe
, cs-tech1-vm
is now a PXE boot server
/srv/saltstack/pillar/cs-tech1-vm/pxe.sls
pxe:default_pxe: 'bootlocal'
clients
list clients
list defines MACs, IP's, and boot settings
preseed: 'pxe-xenial-single-auto'
salt 'cs-tech1-vm*' common.pxe test=True
salt 'cs-tech1-vm*' common.pxe
salt-key -l un
salt-key -a 'cl1n00*'
/srv/saltstack/states/master.d/nodegroups.conf
cabernet: '*.cabernet_net'
systemctl restart salt-master
salt -N cabernet test.ping
salt -N cabernet state.apply
states/top.sls
:
# Does not include head node! 'cabernet': # nodegroup defined in states/master.d/nodegroups.conf - match: nodegroup # Install generic tools for non-LXC machines - common.physical # Config sshd for remote access and place keys - common.ssh # /etc/resolv.conf - common.networking.dns # Use eth0 naming - common.grub # NFS mounts from head node - cluster.nfs_mounts # Set up interfaces - cluster.dhcp # Package caching - common.squid_deb_proxy.client
salt -N cabernet state.apply test=True
salt -N cabernet state.apply
salt -N cabernet system.reboot
salt -N cabernet test.ping
-- NathanFish - 2018-04-26 -- MikeGore - 2018-04-26