|
| 1 | +--- |
| 2 | +# .. vim: foldmarker=[[[,]]]:foldmethod=marker |
| 3 | + |
| 4 | +# debops.bootstrap default variables [[[ |
| 5 | +# ====================================== |
| 6 | + |
| 7 | +# .. contents:: Sections |
| 8 | +# :local: |
| 9 | +# |
| 10 | +# .. include:: includes/all.rst |
| 11 | + |
| 12 | + |
| 13 | +# Hostname and domain [[[ |
| 14 | +# ----------------------- |
| 15 | + |
| 16 | +# .. envvar:: bootstrap__hostname_domain_config_enabled [[[ |
| 17 | +# |
| 18 | +# Should the hostname and domain be configured during bootstrap? |
| 19 | +bootstrap__hostname_domain_config_enabled: '{{ (True |
| 20 | + if (ansible_local|d() and |
| 21 | + ansible_local.cap12s|d() and |
| 22 | + (not ansible_local.cap12s.enabled|bool or |
| 23 | + "cap_sys_admin" in ansible_local.cap12s.list)) |
| 24 | + else False) | bool }}' |
| 25 | + |
| 26 | + # ]]] |
| 27 | +# .. envvar:: bootstrap__domain [[[ |
| 28 | +# |
| 29 | +# Set custom DNS domain on a given host. |
| 30 | +bootstrap__domain: '{{ inventory_hostname.split(".")[1:] | join(".") }}' |
| 31 | + |
| 32 | + # ]]] |
| 33 | +# .. envvar:: bootstrap__hostname [[[ |
| 34 | +# |
| 35 | +# Set custom DNS hostname on a given host. |
| 36 | +bootstrap__hostname: '{{ inventory_hostname_short | d(inventory_hostname.split(".")[0]) }}' |
| 37 | + |
| 38 | + # ]]] |
| 39 | +# .. envvar:: bootstrap__hostname_v6_loopback [[[ |
| 40 | +# |
| 41 | +# Set custom DNS hostname on a given host also for IPv6. |
| 42 | +# This is only needed when you don't have properly working DNS and still need |
| 43 | +# to resolve the hostname as IPv6 address. |
| 44 | +# Refer to https://github.com/debops/ansible-bootstrap/pull/9 |
| 45 | +bootstrap__hostname_v6_loopback: False |
| 46 | + # ]]] |
| 47 | + # ]]] |
| 48 | +# APT and packages [[[ |
| 49 | +# -------------------- |
| 50 | + |
| 51 | +# .. envvar:: bootstrap__raw [[[ |
| 52 | +# |
| 53 | +# Ensure :envvar:`bootstrap__mandatory_packages` are installed using ``raw`` Ansible |
| 54 | +# module before proceeding. |
| 55 | +bootstrap__raw: True |
| 56 | + |
| 57 | + # ]]] |
| 58 | +# .. envvar:: bootstrap__mandatory_packages [[[ |
| 59 | +# |
| 60 | +# Mandatory packages installed during bootstrap. |
| 61 | +bootstrap__mandatory_packages: |
| 62 | + - 'python' |
| 63 | + - 'python-apt' |
| 64 | + |
| 65 | + # ]]] |
| 66 | +# .. envvar:: bootstrap__base_packages [[[ |
| 67 | +# |
| 68 | +# Base packages installed during bootstrap. |
| 69 | +bootstrap__base_packages: |
| 70 | + - 'python-pip' |
| 71 | + - 'sudo' |
| 72 | + - 'lsb-release' |
| 73 | + - 'dbus' |
| 74 | + |
| 75 | + # ]]] |
| 76 | +# .. envvar:: bootstrap__packages [[[ |
| 77 | +# |
| 78 | +# Install additional packages during bootstrap. |
| 79 | +bootstrap__packages: [] |
| 80 | + # ]]] |
| 81 | + # ]]] |
| 82 | +# System administrator accounts [[[ |
| 83 | +# --------------------------------- |
| 84 | + |
| 85 | +# .. envvar:: bootstrap__admin [[[ |
| 86 | +# |
| 87 | +# Enable configuration of administrator accounts. |
| 88 | +bootstrap__admin: True |
| 89 | + |
| 90 | + # ]]] |
| 91 | +# .. envvar:: bootstrap__admin_system [[[ |
| 92 | +# |
| 93 | +# Should the admin accounts be system accounts (UID < 1000) if not specified |
| 94 | +# otherwise? |
| 95 | +bootstrap__admin_system: True |
| 96 | + |
| 97 | + # ]]] |
| 98 | +# .. envvar:: bootstrap__admin_default_users [[[ |
| 99 | +# |
| 100 | +# List of default user accounts created by the role. See |
| 101 | +# :ref:`bootstrap__ref_admin_users` for more details. |
| 102 | +bootstrap__admin_default_users: |
| 103 | + - name: '{{ ansible_ssh_user |
| 104 | + if (ansible_ssh_user | d() and |
| 105 | + ansible_ssh_user != "root") |
| 106 | + else ansible_user |
| 107 | + if (ansible_user | d() and |
| 108 | + ansible_user != "root") |
| 109 | + else lookup("env", "USER") }}' |
| 110 | + |
| 111 | + # ]]] |
| 112 | +# .. envvar:: bootstrap__admin_users [[[ |
| 113 | +# |
| 114 | +# List of additional user accounts created by the role. See |
| 115 | +# :ref:`bootstrap__ref_admin_users` for more details. |
| 116 | +bootstrap__admin_users: [] |
| 117 | + |
| 118 | + # ]]] |
| 119 | +# .. envvar:: bootstrap__admin_groups [[[ |
| 120 | +# |
| 121 | +# List of local system groups which admin accounts will be added to. If any |
| 122 | +# groups don't exists, they will be automatically created as "system" groups |
| 123 | +# with GID < 1000. |
| 124 | +# |
| 125 | +# The first specified group is used as the :command:`sudo` passwordless admin group. |
| 126 | +# |
| 127 | +# All new user accounts will have their home directories in the first group |
| 128 | +# listed here as well, to allow eaiser communication between administrators. |
| 129 | +bootstrap__admin_groups: [ 'admins', 'staff', 'adm', 'sudo' ] |
| 130 | + |
| 131 | + # ]]] |
| 132 | +# .. envvar:: bootstrap__admin_home_path [[[ |
| 133 | +# |
| 134 | +# Root path of the home directory of the admin accounts, when they are "normal" |
| 135 | +# user accounts with UID and GID >= 1000. |
| 136 | +bootstrap__admin_home_path: '/home' |
| 137 | + |
| 138 | + # ]]] |
| 139 | +# .. envvar:: bootstrap__admin_home_path_system [[[ |
| 140 | +# |
| 141 | +# Root path of the home directory of the admin accounts, when they are "system" |
| 142 | +# user accounts with UID and GID < 1000. |
| 143 | +bootstrap__admin_home_path_system: '/var/local' |
| 144 | + |
| 145 | + # ]]] |
| 146 | +# .. envvar:: bootstrap__admin_home_group [[[ |
| 147 | +# |
| 148 | +# New admin accounts will have their home directories in this system group to |
| 149 | +# allow easier data exchange between system administrators. |
| 150 | +bootstrap__admin_home_group: '{{ bootstrap__admin_groups[0] }}' |
| 151 | + |
| 152 | + # ]]] |
| 153 | +# .. envvar:: bootstrap__admin_home_mode [[[ |
| 154 | +# |
| 155 | +# Specify permissions for new admin account home directories. |
| 156 | +bootstrap__admin_home_mode: '0750' |
| 157 | + |
| 158 | + # ]]] |
| 159 | +# .. envvar:: bootstrap__admin_comment [[[ |
| 160 | +# |
| 161 | +# Default comment / GECOS field which is set on the new admin accounts if none |
| 162 | +# is specified. |
| 163 | +bootstrap__admin_comment: 'System Administrator' |
| 164 | + |
| 165 | + # ]]] |
| 166 | +# .. envvar:: bootstrap__admin_shell [[[ |
| 167 | +# |
| 168 | +# Default shell set on the new admin accounts if none is specified. |
| 169 | +bootstrap__admin_shell: '/bin/bash' |
| 170 | + |
| 171 | + # ]]] |
| 172 | +# .. envvar:: bootstrap__admin_sshkeys [[[ |
| 173 | +# |
| 174 | +# List of SSH keys configured on root and administrator accounts. It takes all |
| 175 | +# active keys from your current ssh agent session plus all public keys which you |
| 176 | +# keep in the :file:`~/.ssh/` directory of the user which you are bootstraping DebOps |
| 177 | +# from. If you are not happy with that scenario, for example you have some keys |
| 178 | +# which you don't like to be included, please modify the variable accordingly |
| 179 | +# to your requirements. |
| 180 | +bootstrap__admin_sshkeys: [ '{{ lookup("pipe","ssh-add -L | grep ^ssh || cat ~/.ssh/*.pub || true") }}' ] |
| 181 | + # ]]] |
| 182 | + # ]]] |
| 183 | +# Access to sudo commands [[[ |
| 184 | +# --------------------------- |
| 185 | + |
| 186 | +# .. envvar:: bootstrap__sudo [[[ |
| 187 | +# |
| 188 | +# Configure passwordless :command:`sudo` access for selected accounts. |
| 189 | +bootstrap__sudo: True |
| 190 | + |
| 191 | + # ]]] |
| 192 | +# .. envvar:: bootstrap__sudo_group [[[ |
| 193 | +# |
| 194 | +# A group which grants passwordless :command:`sudo` access. |
| 195 | +bootstrap__sudo_group: '{{ bootstrap__admin_groups[0] | default("") }}' |
| 196 | + # ]]] |
| 197 | + # ]]] |
| 198 | + # ]]] |
0 commit comments