Skip to content
Snippets Groups Projects
Jörg Sachse's avatar
Jörg Sachse authored
fix: ignore vars/network.yml, because it has to be provided separately for each install run anyway and isn't suitable for version control
1ac3d42b
History

Ansible-Role "ansible_lza_bootstrap_rhel_server"

Description

This role provides all necessary tasks to initialise RHEL 7 servers for SLUBArchiv before a non-root user takes over for further managemant.

Prerequisites

To use this role, the following software must be installed on your workstation:

  • ansible

To deploy this role to a managed host, the following software must be installed on the target:

  • Python3
  • SSHd

General usage

Most options already have sensible defaults in ansible.cfg. However, you can override these defaults using CLI options/flags if you want to.

To simply run the playbook, just call the site.yml playbook like this:

	ansible-playbook site.yml -u <username>

If you want to limit the execution to a subset of all hosts that are listed in the inventory, use the -l or --limit option like this:

	ansible-playbook site.yml -l <hostna*>
	ansible-playbook site.yml -l <hostname>
	ansible-playbook site.yml -l <hostname1>:<hostname2>:...
	ansible-playbook site.yml -l <inventory_group>
	ansible-playbook site.yml --limit=<hostna*>

If you do not have Vault password files in the directory above the role direcory, you have to give the Vault password before execution:

	ansible-playbook site.yml --ask-vault-pass

You can use your own inventory file by adding the -i or --inventory=INVENTORY option:

	ansible-playbook site.yml -i inventory.yml
	ansible-playbook site.yml --inventory=inventory.yml

Tasks in this role have been tagged to enable users to only run subsets of tasks. This can be leveraged to decrease run times or run only certain tasks after small changes. To list all available tags, use:

	ansible-playbook site.yml --list-tags

You can then run only certain tagged tasks by using the --tags option:

	ansible-playbook site.yml -t tag1,tag2,...,tagN
	ansible-playbook site.yml --tags=tag1,tag2,...,tagN

For more help with ansible-playbook, use the --help flag.

Testing the role

Tests have been implemented using the Molecule framework. The details on using the test suite are described below molecule/.

Variables

Many variables have been "hidden" in encrypted Ansible Vaults. For security reasons, these Vaults are maintained in a separate private internal repository of SLUB's Git. However, in order to better understand the data within the vaults, you can find \*.vault.example files below the vars/ directory.

git configuration

Just run the setup_gitconfig.sh script that comes with the repo to correctly setup all necessary local Git configurations.

Author Information

If you have any comments or find bugs, please contact langzeitarchiv@slub-dresden.de or issue a pull request.