diff --git a/docs/rolereference.rst b/docs/rolereference.rst index 93630c1e0dde242c1258747ca74bd08caed8e52c..a69fbe9d7e6d5148e994cff742dc78c988ed3279 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -9,130 +9,136 @@ The ``preseed`` role can be used for generating simple preseed files for Debian Wheezy installations. The generated preseed files allow simplified installation, with a single root -partition. A number of common parameters can be provided. +partition. There is a number of parameters that allow for customising the +content of preseed files. + +It is possible to specify parameter values that should be used for all servers, +as well for individual servers. It is also possible to combine this approach, +defining global parameters that get overridden per server. + +The role will by default process all hosts from the inventory, generating one +preseed file per server. Parameters ~~~~~~~~~~ -**ansible_key** (string, mandatory) +**ansible_key** (string, optional, ``{{ lookup('file', '~/.ssh/id_rsa.pub') }}``) SSH public key that should be deployed to authorized_keys truststore for operating system user ``root``. This is necessary for the bootstrap process to work since Debian Jessie does not allow password-based logins for root. -**preseed_directory** (mandatory) - Destination directory where the preseed files should be stored. +**preseed_country** (string, optional, ``SE``) + Country. -**preseed_servers** (mandatory) - List of servers for which a preseed file should be created. Each item in - this list defines options for a single server. The options are as follows: +**preseed_directory** (string, optional, ``../preseed_files/``) + Destination directory where the preseed files should be stored. - **name** (string, mandatory) - Name associated with the server. This name is used in the preseed - configuration filename. + .. warning:: + Do not name this directory ``preseed`` if it lies on a path where Ansible + would normally look-up the roles (it will conflict with the role name). - **language** (string, mandatory) - Language. +**preseed_dns** (string, mandatory if **preseed_network_auto** is ``no``) + Comma-separated list of DNS servers. - **country** (string, mandatory) - Country. +**preseed_domain** (string, mandatory if **preseed_network_auto** is ``no``) + Server domain. - **locale** (string, mandatory) - Locale. +**preseed_gateway** (string, mandatory if **preseed_network_auto** is ``no``) + Default gateway for the server. - **keymap** (string, mandatory) - Keymap. +**preseed_hostname** (string, mandatory if **preseed_network_auto** is ``no``) + Server hostname. - **network_interface** (string, mandatory) - Name of network interface (for example *eth0*) that should be - configured. +**preseed_ip** (string, mandatory if **preseed_network_auto** is ``no``) + IP address for the server network interface. - **network_auto** (boolean, mandatory) - Specifies whether the network configuration should be automatic (using - DHCP) or manual. If manual configuration is selected a number of - additional options needs to be specified. +**preseed_keymap** (string, optional, ``us``) + Keymap. - **network_ip** (string, mandatory if **network_auto** is set to ``no``) - IP address for the server network interface. +**preseed_language** (string, optional, ``en``) + Language. - **network_netmask** (string, mandatory if **network_auto** is set to ``no``) - Netmask for the server network interface. +**preseed_locale** (string, optional, ``en_US.UTF-8``) + Locale. - **network_gateway** (string, mandatory if **network_auto** is set to ``no``) - Default gateway for the server. +**preseed_mirror_directory** (string, optional, ``/debian``) + Directory under which the Debian apt repositories can be found on the + specified mirror. - **network_dns** (string, mandatory if **network_auto** is set to ``no``) - Comma-separated list of DNS servers. +**preseed_mirror_hostname** (string, optional, ``ftp.se.debian.org``) + Resolvable hostname of FQDN where the Debian apt repositories can be + found. Only HTTP mirrors are supported. - **network_hostname** (string, mandatory if **network_auto** is set to ``no``) - Server hostname. +**preseed_mirror_proxy** (string, optional, ``None``) + An HTTP proxy that should be used for accessing the Debian apt + repositories. - **network_domain** (string, mandatory if **network_auto** is set to ``no``) - Server domain. +**preseed_netmask** (string, mandatory if **preseed_network_auto** is ``no``) + Netmask for the server network interface. - **mirror_hostname** (string, mandatory) - Resolvable hostname of FQDN where the Debian apt repositories can be - found. Only HTTP mirrors are supported. +**preseed_network_auto** (boolean, optional, ``yes``) + Specifies whether the network configuration should be automatic (using DHCP) + or manual. If manual configuration is selected a number of additional options + needs to be specified: ``preseed_hostname``, ``preseed_domain``, + ``preseed_ip``, ``preseed_netmask``, ``preseed_gateway``, + ``preseed_dns``. For some of these values you may want to use per-server + overrides - see parameter ``preseed_server_overrides``. - **mirror_directory** (string, mandatory) - Directory under which the Debian apt repositories can be found on the - specified mirror. +**preseed_network_interface** (string, optional, ``eth0``) + Name of network interface (for example ``eth0``, ``eth1`` etc) that should be + configured. - **mirror_proxy** (string, optional, default is *None*) - An HTTP proxy that should be used for accessing the Debian apt - repositories. +**preseed_root_password** (string, optional, ``root``) + Initial password that should be set for the server during the installation. - **root_password** (string, mandatory) - Initial password that should be set for the server during the - installation. +**preseed_server_overrides** (string, optional, ``{}``) + A dictionary consisting out of one or more entries where individual values for + preseed files can be overridden per-server. Each entry's key should be the + name of the server, as specified in the inventory. Each value should also be a + dictionary, where valid keys are: ``country``, ``dns``, ``domain``, + ``gateway``, ``hostname``, ``ip``, ``keymap``, ``language``, ``locale``, + ``mirror_directory``, ``mirror_hostname``, ``mirror_proxy``, ``netmask``, + ``network_auto``, ``network_interface``, ``root_password``, + ``timezone``. These have the same meaning as their ``preseed_`` counterparts. - **timezone** (string, mandatory) - Timezone that should be used when calculating server time. It is assumed - that the local hardware clock is set to UTC. +**preseed_timezone** (string, optional, ``Europe/Stockholm``) + Timezone that should be used when calculating server time. It is assumed that + the local hardware clock is set to UTC. Examples ~~~~~~~~ -Here is an example configuration for a preseed file for two servers, one with -automatic and one with manual network configuration: +Here is an example configuration for a preseed file that sets some global +defaults to be used for all servers, and then overrides it for one server: .. code-block:: yaml --- - preseed_directory: /var/www/preseed/ - - preseed_servers: - - name: test1.example.com - language: en - country: SE - locale: en_US.UTF-8 - keymap: us - network_interface: eth0 - network_auto: yes - mirror_hostname: ftp.se.debian.org - mirror_directory: /debian - mirror_proxy: http://proxy.example.com/ - root_password: testserver - timezone: Europe/Stockholm - - name: test2.example.com - language: en - country: SE - locale: en_US.UTF-8 - keymap: us - network_interface: eth0 + ansible_key: /root/ansible/private.key + preseed_country: UK + preseed_directory: /var/www/preseed + preseed_keymap: UK + preseed_language: en + preseed_locale: en_UK.UTF-8 + preseed_mirror_directory: /debian + preseed_mirror_hostname: ftp.uk.debian.org + preseed_mirror_proxy: "" + preseed_network_auto: yes + preseed_network_interface: eth0 + preseed_root_password: secret + preseed_timezone: Europe/London + preseed_server_overrides: + ldap.example.com: network_auto: no - network_ip: 10.0.0.10 - network_netmask: 255.255.255.0 - network_gateway: 10.0.0.1 - network_dns: 10.0.0.2,10.0.0.3 - network_hostname: test1 - network_domain: example.com - mirror_hostname: ftp.se.debian.org - mirror_proxy: http://proxy.example.com/ - mirror_directory: /debian - root_password: testserver + hostname: ldap + domain: example.com + ip: 192.168.1.20 + netmask: 255.255.255.0 + gateway: 192.168.1.1 + dns: 192.168.1.1,192.168.1.2 timezone: Europe/Stockholm diff --git a/testsite/playbooks/testing.yml b/testsite/playbooks/testing.yml deleted file mode 100644 index 771c781d46d750a12c8758dca12362fa33b6059f..0000000000000000000000000000000000000000 --- a/testsite/playbooks/testing.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- - -- hosts: web - remote_user: ansible - sudo: yes - tasks: - - debug: msg="{{ testsite_domain_underscores }}" - - debug: msg="{{ testsite_domain_alternative }}" - - debug: msg="{{ testsite_ldap_base }}" \ No newline at end of file