Skip to content

Task Templates

There many provided task templates that can be used to extend or help simply a task construction.

TODO: prelude.tmpl TODO: job-helper.tmpl

Set Hostname

To set the hostname on the post-installed system, include this template. It will work for ubuntu and centos-based systems. The place the template in the post-install section of the kickstart or the net-post-install.sh script. The template uses the machine's built in parameters.

{{ template "set-hostname.sh.tmpl" . }}

Warning

While this will work, the better pattern is to use the set-hostname task and inject that into the task flow, if it is not already there. The set-hostname task uses this template directly.

Remote Root Access

This template installs an authorized_keys file in the root user's home directory. Multiple keys may be provided. The template also sets the /etc/ssh/sshd_config entry, PermitRootLogin. The default setting is without-password (keyed access only), but other values are available (no, yes, forced-commands-only).

{{ template "access-keys.sh.tmpl" . }}

An example profile that sets the keys and PermitRootLogin.

Name: root-access
Params:
  access-keys:
    key1:  ssh-rsa abasbaksl;gksj;glasgjasyyp
    key2:  ssh-rsa moreblablabalkhjlkasjg
  access_ssh_root_mode: yes

Warning

While this will work, the better pattern is to use the ssh-access task and inject that into the task flow, if it is not already there. The ssh-access task uses this template directly.