Workstation/Fedora

From Livedoc - The Documentation Repository
Jump to: navigation, search

Fedora Workstation Install

Reboot the computer and press F12 repeatedly while it is starting up. When you get to the netboot.xyz screen, select Linux, and then Fedora, Fedora Workstation, and finally select the latest version of Fedora. When the installer starts, edit the partitions to have 2G of swap and a root partition that takes up the rest of the space. You will need to delete the existing partitions and use standard partitioning (not LVM).

Press install and set the root password. After the installation is finished, reboot. Instead of following the post install steps, press Ctrl+Alt+F2 and login to the machine with the root password you entered earlier.

You will need to ssh into puppet (the salt master server), gain root privileges, and run salt-key -A in order to accept the workstation's salt key. You will need to start the salt-minion before you do this so that the key is sent to the server. If the workstation already has a key with the salt master, you will have to delete it (ex: salt-key -d torvalds.csl.tjhsst.edu).

Run the following commands:

dnf install -y salt-minion
echo "role: workstation" > /etc/salt/grains
systemctl start salt-minion
systemctl enable salt-minion

salt-call state.apply | tee output.txt && reboot

After the commands have finished running and the system has rebooted, run salt-call state.apply one more time, and the workstation should be successfully installed.

Adding and Modifying Salt States

The salt state git repository can be found at https://gitlab.tjhsst.edu/sysadmins/salt. You might need a sysadmin to give you access. The salt states for workstations can be found in salt/tjcsl/workstation inside the repository. You will ned to edit salt/top.sls when adding new salt states.

After you have added or modified a salt state, you will need to commit your changes, push your code, and pull on the salt master (puppet). To pull on the salt master, ssh in and run the following commands as root:

cd /srv
git pull

You will then want to use the commands below to apply your new salt state.

Useful Commands

Run the following commands on puppet (the salt master) to apply commands to all workstations. The -b flag controls batch mode, which runs the command in batches of 20. This prevents the salt master from being overloaded with responses and falsely outputting [Not connected] for some nodes.

The following command is used to apply a salt state to all of the workstations.

salt -G 'role:workstation' state.apply tjcsl.workstation.kernel -b 20

To apply all salt states to all workstations, run:

salt -G 'role:workstation' state.apply -b 20

The following command is used to reboot all of the workstations:

salt -G 'role:workstation' system.reboot -b 20

To log a certain user out of all of the workstations:

salt -G 'role:workstation' cmd.run 'loginctl kill-user <username>' -b 20

To run the misc salt state on all of the workstations except for torvalds, use the following command:

salt -C 'G@role:workstation and not E@torvalds.*' state.apply tjcsl.workstation.misc -b 20

OpenAFS Related Commands

To easily list all of the workstations with failed openafs-client services, use the command below. A return code of not zero indicates that there is a problem with openafs.

salt --state-verbose=false --state-output=terse -G 'role:workstation' cmd.run 'systemctl status openafs-client > /dev/null' -b 20

To recompile the openafs kernel module on a workstation using dkms, run the following command on the workstation:

dkms build -m openafs -v $(ls /usr/src/ | grep 'openafs-' | cut -d '-' -f2-) && dkms autoinstall

To apply this to all of the workstations, run the following command on the salt server:

salt -G 'role:workstation' cmd.run "dkms build -m openafs -v \$(ls /usr/src/ | grep 'openafs-' | cut -d '-' -f2-) && dkms autoinstall" -l debug -b 20