Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.8 KiB

style and variables refactoring - Coherent quotation style Single quotes for text variable (even if implicit), no quotes for variable and conditional statements, if not required. - Some useful tags added: * ssh_certs renewal of server SSH certificates and configuration of authorized CA. * tls_pub renewal of public TLS certificates (let's encrypt) and certbot configuration. * tls_int renewal of internal TLS certificates (service authorizations) and configuration of authorized internal CA. *(ToDo: deployment of Certificate Revokation Lists)* * lxc deployment of new containers (deployment of configuration file excluded, for instance change in ip address are always applied and trigger a container restart even if you skip this tag. * packages installation and upgrade of software packages (apt, opkg or tarballs) * service_password create new random password for services-only password, for routine rotation. Not meant to be skipped (some roles need to know the service password, so they do a rotation). - prepare_host - ssh_server - lxc_guest - ldap - gitlab - x509_subject_prefix - x509_ldap_suffix *Replaces:* x509_suffix in ldap.yaml - letsencrypt_email Used in roles/certbot and roles/gitlab - root_ca_cert *Replaces:* ssl_ca_cert and files/lilik_x1.crt New defaults: - ldap_domain | default: `${domain}` - server_fqdn | default: `${hostname}.dmz.${domain}` *Replaces:* fqdn_domain Removed: - fqdn_dmain - x509_suffix *Replaced by:* x509_ldap_suffix in common New defaults: - server_fqdn | default: `${hostname}.${domain}` *Replaces*: fqdn - ldap_domain | default: `${domain}` - ldap_server | default: `ldap1.dmz.${domain}` - ldap_basedn | default: `dn(${ldap_domain})` - enable_https | default: `true` New defaults: - server_fqdn | default: `${hostname}.${domain}`
5 years ago
  1. # Role: ldap
  2. Set-up a LDAP server
  3. ## Configuration variables
  4. | Name | Description |
  5. |------------------------|----------------------------------------------------|
  6. | `host_fqdn` | FQDN of the host [`$hostname.dmz.$domain`] |
  7. | `ldap_domain` | Dot-form domain name. [`$domain`] |
  8. | `ldap_organization` | Organization [`$organization`] |
  9. | `ldap_check_tree` | Populate tree with initial configuration. [`true`] |
  10. | `ldap_tls_enabled` | Enables TLS, requires a *ca_manager*. [`true`] |
  11. | `ldap_tls_server_ca` | CA to check slapd cert [`$tls_root_ca`] |
  12. | `ldap_tls_user_ca` | CA to authenticate users [`$tls_root_ca`] |
  13. | `virtual_domains` | Required with `check_tree`: list of vds to init. |
  14. **Note:** If `ldap_tls_enabled` the *ca_manager* host should be configured
  15. and TLS Root CA should be set in vars.
  16. ## Minimal example
  17. group_vars/all.yaml:
  18. ---
  19. domain: 'example.com'
  20. organization: 'LILiK'
  21. x509_subj_prefix:
  22. C: 'IT'
  23. L: 'Firenze'
  24. O: '{{ organization }}'
  25. user_ca_keys:
  26. - "ssh-ed25519 ################### CA"
  27. tls_root_ca: |
  28. -----BEGIN CERTIFICATE-----
  29. ###########################
  30. -----END CERTIFICATE-----
  31. hosts:
  32. vm_gateay ansible_host=10.0.2.1 ansible_user=root
  33. authorities_request ansible_host=10.0.1.8 ansible_user=request
  34. host1 ansible_host=10.0.1.1 ansible_user=root
  35. ldap1 ansible_host=10.0.2.2 ansible_user=root ansible_lxc_host=host1
  36. playbook.yaml:
  37. ---
  38. # Configure LDAP on a Physical Host
  39. - hosts: 'host'
  40. roles:
  41. - role: ldap
  42. virtual_domains:
  43. - 'example.com'
  44. Command line:
  45. ansible-playbook -i hosts playbook.yaml
  46. ## Requirements
  47. On Ansible controller:
  48. - tasks/ca-dialog.yaml