From b99525d19db9840a641542380ad22ba63c7a381d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 13 Jun 2018 16:17:46 +0300 Subject: Change: extract all vars user is expected Put my vars into liw.yml. All variables in group_vars/* and roles/*/defaults/main.yml are now expected to be generic and usable by anyone. --- group_vars/apt.yml | 9 +- group_vars/ickhost.yml | 20 ++-- group_vars/notify.yml | 8 +- group_vars/qvisqve.yml | 29 +++-- ick-cluster.yml | 6 +- ick2.yml | 2 +- liw.yml | 76 +++++++++++++ roles/apt_repository/templates/apache-https.conf | 26 ----- roles/apt_repository/templates/apache.conf | 118 --------------------- .../templates/artifact_store.yaml.j2 | 2 +- roles/ick-controller/templates/controller.yaml.j2 | 2 +- roles/ick-notifier/templates/notifications.yaml.j2 | 2 +- 12 files changed, 112 insertions(+), 188 deletions(-) create mode 100644 liw.yml delete mode 100644 roles/apt_repository/templates/apache-https.conf delete mode 100644 roles/apt_repository/templates/apache.conf diff --git a/group_vars/apt.yml b/group_vars/apt.yml index 70fa580..39c33c0 100644 --- a/group_vars/apt.yml +++ b/group_vars/apt.yml @@ -1,10 +1,9 @@ apt_uploader_ssh_public_keys: - "{{ wm_ssh_key_pub }}" -apt_signing_key: "{{ lookup('pipe', 'pass show ick2/apt_key') }}" -apt_signing_key_pub: "{{ lookup('pipe', 'pass show ick2/apt_key.pub') }}" -apt_signing_key_fingerprint: | - {{ lookup('pipe', 'pass show ick2/apt_key.pub | gpg --with-colons | grep "^fpr:" | cut -d: -f10') }} -apt_admin_email: liw@liw.fi +apt_signing_key: FIXME +apt_signing_key_pub: FIXME +apt_signing_key_fingerprint: FIXME +apt_admin_email: FIXME apt_distributions: - codename: stretch description: Release packages for stretch diff --git a/group_vars/ickhost.yml b/group_vars/ickhost.yml index ec545e4..aa922f4 100644 --- a/group_vars/ickhost.yml +++ b/group_vars/ickhost.yml @@ -1,3 +1,6 @@ +qvisqve_token_public_key: FIXME +tls_certificate: FIXME + debian_codename: stretch debian_mirror: deb.debian.org debian_mirror_src: deb.debian.org @@ -9,10 +12,6 @@ sources_lists: keyring_package: code.liw.fi-keyring signing_key: "{{ code_liw_fi_signing_key }}" -token_private_key: "{{ lookup('pipe', 'pass show ick2/token_key') }}" -token_public_key: "{{ lookup('pipe', 'pass show ick2/token_key.pub') }}" -tls_certificate: "{{ lookup('pipe', 'pass show ick2/ick.pem') }}" - controller_port: 12765 artifact_store_port: 12766 qvisqve_port: 10000 @@ -25,11 +24,10 @@ notify_url: "https://{{ notify_domain }}/notify" apt_uploader_ssh_public_keys: - "{{ wm_ssh_key_pub }}" -apt_signing_key: "{{ lookup('pipe', 'pass show ick2/apt_key') }}" -apt_signing_key_pub: "{{ lookup('pipe', 'pass show ick2/apt_key.pub') }}" -apt_signing_key_fingerprint: | - {{ lookup('pipe', 'pass show ick2/apt_key.pub | gpg --with-colons | grep "^fpr:" | cut -d: -f10') }} -apt_admin_email: liw@liw.fi +apt_signing_key: FIXME +apt_signing_key_pub: FIXME +apt_signing_key_fingerprint: FIXME +apt_admin_email: FIXME -wm_ssh_key: "{{ lookup('pipe', 'pass show ick2/wm_ssh_key') }}" -wm_ssh_key_pub: "{{ lookup('pipe', 'pass show ick2/wm_ssh_key_pub') }}" +wm_ssh_key: FIXME +wm_ssh_key_pub: FIXME diff --git a/group_vars/notify.yml b/group_vars/notify.yml index c620183..4e706b1 100644 --- a/group_vars/notify.yml +++ b/group_vars/notify.yml @@ -1,5 +1,5 @@ -smtp_server: pieni.net -smtp_port: 587 -smtp_user: pienirelay -smtp_password: "{{ lookup('pipe', 'pass show pieni.net/pienirelay') }}" +smtp_server: FIXME +smtp_port: FIXME +smtp_user: FIXME +smtp_password: FIXME diff --git a/group_vars/qvisqve.yml b/group_vars/qvisqve.yml index 92dcd90..caf571e 100644 --- a/group_vars/qvisqve.yml +++ b/group_vars/qvisqve.yml @@ -1,8 +1,5 @@ qvisqve_port: 10000 -qvisqve_token_public_key: "{{ lookup('pipe', 'pass show ick2/token_key.pub') }}" -qvisqve_token_private_key: "{{ lookup('pipe', 'pass show ick2/token_key') }}" -qvisqve_client_hash: "{{ lookup('pipe', 'pass show ick2/liw_hash') }}" -qvisqve_client_salt: "{{ lookup('pipe', 'pass show ick2/liw_salt') }}" +qvisqve_token_private_key: FIXME qvisqve_clients: admin: allowed_scopes: @@ -27,8 +24,8 @@ qvisqve_clients: - uapi_workers_id_get - uapi_notify_post client_secret: - hash: "{{ lookup('pipe', 'pass show ick2/liw_hash') }}" - salt: "{{ lookup('pipe', 'pass show ick2/liw_salt') }}" + hash: "{{ qvisqve_admin_hash }}" + salt: "{{ qvisqve_admin_salt }}" N: 16384 key_len: 128 p: 1 @@ -46,8 +43,8 @@ qvisqve_clients: - uapi_builds_id_get - uapi_logs_id_get client_secret: - hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" - salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" + hash: "{{ qvisqve_worker1_hash }}" + salt: "{{ qvisqve_worker1_salt }}" N: 16384 key_len: 128 p: 1 @@ -65,8 +62,8 @@ qvisqve_clients: - uapi_builds_id_get - uapi_logs_id_get client_secret: - hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" - salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" + hash: "{{ qvisqve_worker1_hash }}" + salt: "{{ qvisqve_worker1_salt }}" N: 16384 key_len: 128 p: 1 @@ -84,8 +81,8 @@ qvisqve_clients: - uapi_builds_id_get - uapi_logs_id_get client_secret: - hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" - salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" + hash: "{{ qvisqve_worker2_hash }}" + salt: "{{ qvisqve_worker2_salt }}" N: 16384 key_len: 128 p: 1 @@ -103,8 +100,8 @@ qvisqve_clients: - uapi_builds_id_get - uapi_logs_id_get client_secret: - hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" - salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" + hash: "{{ qvisqve_worker3_hash }}" + salt: "{{ qvisqve_worker3_salt }}" N: 16384 key_len: 128 p: 1 @@ -122,8 +119,8 @@ qvisqve_clients: - uapi_builds_id_get - uapi_logs_id_get client_secret: - hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" - salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" + hash: "{{ qvisqve_worker4_hash }}" + salt: "{{ qvisqve_worker4_salt }}" N: 16384 key_len: 128 p: 1 diff --git a/ick-cluster.yml b/ick-cluster.yml index 8c59fb2..c699ab1 100644 --- a/ick-cluster.yml +++ b/ick-cluster.yml @@ -25,7 +25,5 @@ vars: hostname: ick - verify_tls: yes - letsencrypt: yes - letsencrypt_email: liw@liw.fi - letsencrypt_domain: "{{ controller_domain }}" + verify_tls: no + letsencrypt: no diff --git a/ick2.yml b/ick2.yml index b505687..b91d435 100644 --- a/ick2.yml +++ b/ick2.yml @@ -18,4 +18,4 @@ verify_tls: no letsencrypt: no - tls_certificate: "{{ lookup('pipe', 'pass show ick2/ick.pem') }}" + tls_certificate: FIXME diff --git a/liw.yml b/liw.yml new file mode 100644 index 0000000..b5e5d1e --- /dev/null +++ b/liw.yml @@ -0,0 +1,76 @@ +# Should API clients in the ick instance verify that TLS certificates +# are signed by a known CA? Set to "no" if using self-signed certs. +verify_tls: no + + +# Should Let's Encrypt be used to get TLS certificates for the +# controller component? If not, the certificate defined in +# tls_certificate gets deployed instead. +letsencrypt: no +letsencrypt_email: liw@liw.fi +letsencrypt_domain: "{{ controller_domain }}" +tls_certificate: "{{ lookup('pipe', 'pass show ick2/ick.pem') }}" + + +# The Apache config for serving the APT repository needs to know the +# webmaster email. +apt_admin_email: liw@liw.fi + + +# The APT repository gets signed using a PGP key. +apt_signing_key: "{{ lookup('pipe', 'pass show ick2/apt_key') }}" +apt_signing_key_pub: "{{ lookup('pipe', 'pass show ick2/apt_key.pub') }}" +apt_signing_key_fingerprint: | + {{ lookup('pipe', 'pass show ick2/apt_key.pub | gpg --with-colons | grep "^fpr:" | cut -d: -f10') }} + + +# Workers should each have separate ssh keys. FIXME: We only support +# the same key for each, at the moment. +wm_ssh_key: "{{ lookup('pipe', 'pass show ick2/wm_ssh_key') }}" +wm_ssh_key_pub: "{{ lookup('pipe', 'pass show ick2/wm_ssh_key_pub') }}" + + +# The notification service needs access to an SMTP server to send +# email. Ideally using the 587 port to submit the mail; this usually +# require authentication. STARTTLS will be used to talk to the SMTP +# server unconditionally. +smtp_server: pieni.net +smtp_port: 587 +smtp_user: pienirelay +smtp_password: "{{ lookup('pipe', 'pass show pieni.net/pienirelay') }}" + + +# Qvisqve handles authentication of API clients and signs its access +# tokens using RSA public keys. Define the signing keys, plus an admin +# user (for using with icktool), and four workers. FIXME: each worker +# has here the same client secret. +qvisqve_token_public_key: "{{ lookup('pipe', 'pass show ick2/token_key.pub') }}" +qvisqve_token_private_key: "{{ lookup('pipe', 'pass show ick2/token_key') }}" +qvisqve_admin_hash: "{{ lookup('pipe', 'pass show ick2/liw_hash') }}" +qvisqve_admin_salt: "{{ lookup('pipe', 'pass show ick2/liw_salt') }}" +qvisqve_worker1_hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" +qvisqve_worker1_salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" +qvisqve_worker2_hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" +qvisqve_worker2_salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" +qvisqve_worker3_hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" +qvisqve_worker3_salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" +qvisqve_worker4_hash: "{{ lookup('pipe', 'pass show ick2/worker1_hash') }}" +qvisqve_worker4_salt: "{{ lookup('pipe', 'pass show ick2/worker1_salt') }}" + + +# I like to have an addition "dist" in the APT repository, liwdev, so +# I can have ick build from a liw/dev branch, in addition to master, +# and put the resulting Debian packages where they don't get confused +# with the ones from master. Some day this will not require +# re-configuration of the APT repository via Ansible. +apt_distributions: + - codename: stretch + description: Release packages for stretch + - codename: stretch-ci + description: CI builds for stretch + - codename: unstable + description: Release packages for unstable + - codename: unstable-ci + description: CI builds for unstable + - codename: liw-ci + description: CI builds for unstable from liw diff --git a/roles/apt_repository/templates/apache-https.conf b/roles/apt_repository/templates/apache-https.conf deleted file mode 100644 index dd0b490..0000000 --- a/roles/apt_repository/templates/apache-https.conf +++ /dev/null @@ -1,26 +0,0 @@ - - ServerAdmin {{ apt_admin_email }} - - ServerName {{ letsencrypt_domain }} - - DocumentRoot /srv/http - Alias "/debian" "/srv/apt" - - - Require all granted - - - - Options +Indexes - Require all granted - - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - - SSLEngine on - - SSLCertificateFile /etc/letsencrypt/live/{{ letsencrypt_domain }}/fullchain.pem - SSLCertificateKeyFile /etc/letsencrypt/live/{{ letsencrypt_domain }}/privkey.pem - - diff --git a/roles/apt_repository/templates/apache.conf b/roles/apt_repository/templates/apache.conf deleted file mode 100644 index ec3c3c3..0000000 --- a/roles/apt_repository/templates/apache.conf +++ /dev/null @@ -1,118 +0,0 @@ - - ServerAdmin {{ apt_admin_email }} - ServerName {{ apt_domain }} - - DocumentRoot /srv/http - Alias "/debian" "/srv/apt" - - - Require all granted - - - - Options +Indexes - Require all granted - - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - - # SSLEngine on - - # A self-signed (snakeoil) certificate can be created by installing - # the ssl-cert package. See - # /usr/share/doc/apache2/README.Debian.gz for more info. - # If both key and certificate are stored in the same file, only the - # SSLCertificateFile directive is needed. - # SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem - # SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key - - # Server Certificate Chain: - # Point SSLCertificateChainFile at a file containing the - # concatenation of PEM encoded CA certificates which form the - # certificate chain for the server certificate. Alternatively - # the referenced file can be the same as SSLCertificateFile - # when the CA certificates are directly appended to the server - # certificate for convinience. - #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt - - # Certificate Authority (CA): - # Set the CA certificate verification path where to find CA - # certificates for client authentication or alternatively one - # huge file containing all of them (file must be PEM encoded) - # Note: Inside SSLCACertificatePath you need hash symlinks - # to point to the certificate files. Use the provided - # Makefile to update the hash symlinks after changes. - #SSLCACertificatePath /etc/ssl/certs/ - #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt - - # Certificate Revocation Lists (CRL): - # Set the CA revocation path where to find CA CRLs for client - # authentication or alternatively one huge file containing all - # of them (file must be PEM encoded) - # Note: Inside SSLCARevocationPath you need hash symlinks - # to point to the certificate files. Use the provided - # Makefile to update the hash symlinks after changes. - #SSLCARevocationPath /etc/apache2/ssl.crl/ - #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl - - # SSL Engine Options: - # Set various options for the SSL engine. - # o FakeBasicAuth: - # Translate the client X.509 into a Basic Authorisation. This means that - # the standard Auth/DBMAuth methods can be used for access control. The - # user name is the `one line' version of the client's X.509 certificate. - # Note that no password is obtained from the user. Every entry in the user - # file needs this password: `xxj31ZMTZzkVA'. - # o ExportCertData: - # This exports two additional environment variables: SSL_CLIENT_CERT and - # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the - # server (always existing) and the client (only existing when client - # authentication is used). This can be used to import the certificates - # into CGI scripts. - # o StdEnvVars: - # This exports the standard SSL/TLS related `SSL_*' environment variables. - # Per default this exportation is switched off for performance reasons, - # because the extraction step is an expensive operation and is usually - # useless for serving static content. So one usually enables the - # exportation for CGI and SSI requests only. - # o OptRenegotiate: - # This enables optimized SSL connection renegotiation handling when SSL - # directives are used in per-directory context. - #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire - # - # SSLOptions +StdEnvVars - # - # - # SSLOptions +StdEnvVars - # - - # SSL Protocol Adjustments: - # The safe and default but still SSL/TLS standard compliant shutdown - # approach is that mod_ssl sends the close notify alert but doesn't wait for - # the close notify alert from client. When you need a different shutdown - # approach you can use one of the following variables: - # o ssl-unclean-shutdown: - # This forces an unclean shutdown when the connection is closed, i.e. no - # SSL close notify alert is send or allowed to received. This violates - # the SSL/TLS standard but is needed for some brain-dead browsers. Use - # this when you receive I/O errors because of the standard approach where - # mod_ssl sends the close notify alert. - # o ssl-accurate-shutdown: - # This forces an accurate shutdown when the connection is closed, i.e. a - # SSL close notify alert is send and mod_ssl waits for the close notify - # alert of the client. This is 100% SSL/TLS standard compliant, but in - # practice often causes hanging connections with brain-dead browsers. Use - # this only for browsers where you know that their SSL implementation - # works correctly. - # Notice: Most problems of broken clients are also related to the HTTP - # keep-alive facility, so you usually additionally want to disable - # keep-alive for those clients, too. Use variable "nokeepalive" for this. - # Similarly, one has to force some clients to use HTTP/1.0 to workaround - # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and - # "force-response-1.0" for this. - # BrowserMatch "MSIE [2-6]" \ - # nokeepalive ssl-unclean-shutdown \ - # downgrade-1.0 force-response-1.0 - - diff --git a/roles/ick-artifact-store/templates/artifact_store.yaml.j2 b/roles/ick-artifact-store/templates/artifact_store.yaml.j2 index 586364c..e62079f 100644 --- a/roles/ick-artifact-store/templates/artifact_store.yaml.j2 +++ b/roles/ick-artifact-store/templates/artifact_store.yaml.j2 @@ -1,6 +1,6 @@ token-issuer: "{{ qvisqve_url }}" token-audience: localhost -token-public-key: "{{ token_public_key }}" +token-public-key: "{{ qvisqve_token_public_key }}" log: - filename: /var/log/ickas/artifact_store.log blobdir: /var/lib/ick/blobs diff --git a/roles/ick-controller/templates/controller.yaml.j2 b/roles/ick-controller/templates/controller.yaml.j2 index 3f4dad6..bd514ca 100644 --- a/roles/ick-controller/templates/controller.yaml.j2 +++ b/roles/ick-controller/templates/controller.yaml.j2 @@ -3,7 +3,7 @@ notify-url: "{{ notify_url }}" auth-url: "{{ qvisqve_url }}/token" token-issuer: "{{ qvisqve_url }}" token-audience: localhost -token-public-key: "{{ token_public_key }}" +token-public-key: "{{ qvisqve_token_public_key }}" log: - filename: /var/log/ick/controller.log statedir: /var/lib/ick/state diff --git a/roles/ick-notifier/templates/notifications.yaml.j2 b/roles/ick-notifier/templates/notifications.yaml.j2 index fde0583..1dcc913 100644 --- a/roles/ick-notifier/templates/notifications.yaml.j2 +++ b/roles/ick-notifier/templates/notifications.yaml.j2 @@ -1,6 +1,6 @@ token-issuer: "{{ qvisqve_url }}" token-audience: localhost -token-public-key: "{{ token_public_key }}" +token-public-key: "{{ qvisqve_token_public_key }}" log: - filename: /var/log/ickns/notification_service.log from_addr: Lars Wirzenius -- cgit v1.2.1