Roles
Namespace vbotka
If you want to install other roles from the namespace vbotka, see setup/vars/roles.yml. The
dictionary bsd_roles keeps the tested roles
bsd_roles:
- galaxy: vbotka.ansible
name: ansible
scm: git
src: https://github.com/vbotka/ansible-ansible
version: 2.7.1
- galaxy: vbotka.ansible_lib
name: lib
scm: git
src: https://github.com/vbotka/ansible-lib
version: 2.7.0
...
- galaxy: vbotka.config_light
name: config_light
scm: git
src: https://github.com/vbotka/ansible-config-light
version: 2.7.
...
- galaxy: vbotka.freebsd_custom_image
name: custom_image
scm: git
src: https://github.com/vbotka/ansible-freebsd-custom-image
version: 2.7.5
- galaxy: vbotka.freebsd_dns
name: dns
scm: git
src: https://github.com/vbotka/ansible-freebsd-dns
version: 2.6.2
...
Put the roles you want to install into the list bsd_roles_install in
setup/vars/roles_linstall.yml and run the play
shell> cd setup
shell> ansible-playbook setup.yml -t roles
Manually remove obsolete versions from the directory roles.
Naming convention
The naming convention is simple:
The GitHub repositories’ names always start with
ansible-. If a role works with FreeBSD only, the GitHub name starts withansible-freebsd.The Ansible Galaxy roles’ names start with the namespace
vbotkaand follow with the GitHub name without the prefixansible-where dashes-are replaced with underscores_.The collection roles’ names start with
vbotka.freebsdand follow with the last parts of the GitHub names where dashes-are replaced by underscores_.
For example,
GitHub vbotka |
Galaxy vbotka |
Collection vbotka.freebsd |
|---|---|---|
ansible-ansible |
vbotka.ansible |
vbotka.freebsd.ansible |
ansible-config-light |
vbotka.config_light |
vbotka.freebsd.config_light |
ansible-freebsd-custom-image |
vbotka.freebsd_custom_image |
vbotka.freebsd.custom_image |
The roles imported in the Ansible Galaxy namespace vbotka and included in the collection vbotka.freebsd are identical. You can use them in parallel or interchange them without restrictions.
Note
The roles’ files README.md are imported in the collection documentation. The titles might
be misleading because they keep the Galaxy names. For example, the role
vbotka.freebsd.custom_image documentation says:
freebsd_custom_image
--------------------
This role is included in the collection vbotka.freebsd as vbotka.freebsd.custom_image
Role vbotka.ansible_lib
The role vbotka.ansible_lib comprises independent tasks. The purpose is providing reusable tasks that can be imported or included in playbooks and other roles.
GitHub vbotka |
Galaxy vbotka |
Collection vbotka.freebsd |
|---|---|---|
ansible-lib |
vbotka.ansible_lib |
vbotka.freebsd.lib |
Some roles depend on it. If such roles are included in the collection vbotka.freebsd they are
modified to use the dictionary <name>_ansible_lib. For example, the dictionary rsnapshot_ansible_lib
rsnapshot_ansible_lib:
vbotka.rsnapshot: vbotka.ansible_lib
vbotka.freebsd.rsnapshot: vbotka.freebsd.lib
is used to select vbotka.ansible_lib or vbotka.freebsd.lib depending on the role running in
the collection or not. For example,
- name: "Vars: Include OS vars."
vars:
al_os_vars_path: "{{ ansible_parent_role_paths.0 }}"
ansible.builtin.include_role:
name: "{{ rsnapshot_ansible_lib[ansible_role_name] }}"
tasks_from: al_include_os_vars_path
See also
The special variable ansible_role_name
Other dependent roles
There are other dependent roles. For example, the role vbotka.freebsd.zfs depends on the role
vbotka.freebsd.postinstall. The dictionary fzfs_freebsd_postinstall
fzfs_freebsd_postinstall:
vbotka.freebsd_zfs: vbotka.freebsd_postinstall
vbotka.freebsd.zfs: vbotka.freebsd.postinstall
is used to select vbotka.freebsd_postinstall or vbotka.freebsd.postinstall depending on the
role running in the collection or not. For example,
- name: "Sysctl: Include vbotka.freebsd.postinstall sysctl"
ansible.builtin.include_role:
name: "{{ fzfs_freebsd_postinstall[ansible_role_name] }}"
tasks_from: sysctl.yml
apply:
tags: fzfs_sysctl
vars:
fp_sysctl_conf: "{{ fzfs_sysctl_conf }}"
fp_sysctl_tuneables_warning: "{{ fzfs_sysctl_tuneables_warning | bool }}"
Other roles
If you want to install other roles into this collection update the dictionary bsd_roles.
Note
To install roles outside this collection see Installing roles.
Warning
The collection upgrade will override the changes. Backup your changes before you upgrade the collection.
This collection does not provide an upgrade procedure that preserve changes. After the upgrade, you are responsible for restoring your changes.