From 7b7c3dbde8c7358e92408dba78b4d038f46a0d76 Mon Sep 17 00:00:00 2001 From: Russ Mckendrick Date: Wed, 5 Jun 2019 07:18:15 +0100 Subject: [PATCH] Update - Some final tweaks --- group_vars/wp-dev-schemareview.yml | 19 +++++------ play-rm-dev-schemareview.yml | 2 -- play-wp-dev-schemareview.yml | 32 +++++++++++++++++-- roles/server-sync-whitespace/tasks/main.yml | 8 ++--- .../templates/index.html.j2 | 4 +-- 5 files changed, 45 insertions(+), 20 deletions(-) diff --git a/group_vars/wp-dev-schemareview.yml b/group_vars/wp-dev-schemareview.yml index 8e156fc..ef462ff 100644 --- a/group_vars/wp-dev-schemareview.yml +++ b/group_vars/wp-dev-schemareview.yml @@ -1,15 +1,18 @@ --- -options: - install_trend: false - bootstrap_database: true +# Some options, this should be accessible via survey + +install_trend: true +bootstrap_database_add_user: true +bootstrap_database_create_schema: true +configure_application_gateway: false # Application vars app: name: "wp-dev-schemareview" # this can contain characters such as -, don't get too creative though shortname: "wpdevschem" # all lower-case, all one word - env: "dev" + env: "dev" # working_folder: "/wsdocker" raw_hash: "{{ app.name | hash('sha1') }}" # this creates a hash based on the name of the application @@ -35,8 +38,8 @@ couchbase: bucket: "devbucket" # name of the bucket to create and use admin_port: "18100" additional_users: - - { username: 'sync_gateway_test', password: 'fds234fwer23' } - - { username: 'N1QLUSER_test', password: 'fds234fwer23' } + - { username: '{{ sync_gateway.user }}', password: '{{ sync_gateway.password }}' } + - { username: 'N1QLUSER', password: 'fds234fwer23' } couchbase_bootstrap: rbac_roles: 'bucket_admin[{{couchbase.bucket}}],bucket_full_access[{{couchbase.bucket}}],views_admin[{{couchbase.bucket}}],views_reader[{{couchbase.bucket}}],data_reader[{{couchbase.bucket}}],data_writer[{{couchbase.bucket}}],data_dcp_reader[{{couchbase.bucket}}],data_backup[{{couchbase.bucket}}],data_monitoring[{{couchbase.bucket}}],fts_admin[{{couchbase.bucket}}],fts_searcher[{{couchbase.bucket}}],query_select[{{couchbase.bucket}}],query_update[{{couchbase.bucket}}],query_insert[{{couchbase.bucket}}],query_delete[{{couchbase.bucket}}],query_manage_index[{{couchbase.bucket}}],replication_target[{{couchbase.bucket}}],analytics_manager[{{couchbase.bucket}}]' @@ -53,6 +56,7 @@ sync_gateway: 30306563373237346163333039343661376161313462623036373366313962373763366236396462 3131656633303639330a313537343430626436343239383034316637366532663239633930623632 64663135653631613666633535336338343234353531323038626533393062616133 + admin_port: "18200" ssl_cert_pass: !vault | $ANSIBLE_VAULT;1.1;AES256 @@ -62,7 +66,6 @@ ssl_cert_pass: !vault | 3939653631346332330a373432346639666537663535366138643963323363386437303037346432 61326264633365323939336431653465343162613938643134616638643938303361 ssl_cert_name: "whitespace_ssl_cert" - self_signed_cert_name: "self-signed-cert" containers: @@ -193,8 +196,6 @@ vmss_syncgateway: name: "standard_small" tier: "standard" -configure_application_gateway: "true" - # Which SSH Key to use? The default should be the one used by AWX ssh_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC2c5jDHGDdEGGIUC7dX9y1iyX2F/csqpvYYnWEZ2knA1whUBMwiAR+XxXTW1zInd3I4R6z/8zv4rXLDPn8LeTc5cV0zFY5BxVmvyeObEojOHC9l+yiHUaATs99eJIMd4ph+bNnfFV0uN0FusWjR1d6yDkhCizMhYcGo9g4QSx+qyi85BMuXelwmM57DTRZRgs6JnvcgkLXHUQD0cFuvGFMMDLrIVR5CUVUb76EULSQ+gSSkMVlyoF0h1M9PxhJR6VTtb3QXQ7EB6w8oO9Ke831YMSoU44BIEeImbDSXkEQdZPck+l4LmWF2Om6qLSsNsIGsexMRMH7qJNTRfFleTboOZf9YeJrvyDJg1j7075oCKEHXYO83ZpBZ5mU4dpJYeClVwMtGUNwK7lyRH0zNXipWS7Pm9WAYX0sdk/zwIdUV4U9eK7BkDLXQorHf5vBey/2W5nadjqbA7krlDUUbIR5l3LANI/vA5w5VGqdMlPsNOGftzjkgWci757km4sAHUj1b819ckrnHIeCTNSbYuAKREiLUAo5B2b8vjyHU1EXP1rLvIXwMtor8c6TJWGxiouDL3fbmLLZ8SmHOVaYEzduJMaFZ/8dSr1yEk35kG40ZBnhPEyUCEJ+MMjmhy/EvCPihoC6iM/xqHBKp+45nvhcZoP/prTQHRqey9Bjc8HweQ== whitespace-awx" # ssh_key: "{{lookup('file', '~/.ssh/id_rsa.pub') }}" \ No newline at end of file diff --git a/play-rm-dev-schemareview.yml b/play-rm-dev-schemareview.yml index 745da90..1587636 100644 --- a/play-rm-dev-schemareview.yml +++ b/play-rm-dev-schemareview.yml @@ -68,7 +68,6 @@ vars_files: - group_vars/rm-dev-schemareview.yml - - group_vars/openid-dev.yml roles: - roles/server-database-bootstrap-user @@ -97,7 +96,6 @@ vars_files: - group_vars/rm-dev-schemareview.yml - - group_vars/openid-dev.yml roles: - roles/server-database-bootstrap-schema \ No newline at end of file diff --git a/play-wp-dev-schemareview.yml b/play-wp-dev-schemareview.yml index 8a3317d..bd15b8b 100644 --- a/play-wp-dev-schemareview.yml +++ b/play-wp-dev-schemareview.yml @@ -61,15 +61,41 @@ roles: - roles/server-sync-whitespace -- name: bootstrap the database if needed +- name: bootstrap the database (add create db and add user) hosts: localhost connection: local gather_facts: true + vars_files: + - group_vars/wp-dev-schemareview.yml + + roles: + - roles/server-database-bootstrap-user + +- name: restart the syncgateway + hosts: vmss_syncgateway + gather_facts: true + become: yes + become_method: sudo + + vars_files: + - group_vars/rm-dev-schemareview.yml + + tasks: + - name: restart sync_gateway + systemd: + name: "sync_gateway" + state: "started" + enabled: "true" + when: bootstrap_database_add_user == true + +- name: bootstrap the database (create the schema) + hosts: localhost + connection: local + gather_facts: true vars_files: - group_vars/wp-dev-schemareview.yml - - group_vars/openid-dev.yml roles: - - roles/server-database-bootstrap \ No newline at end of file + - roles/server-database-bootstrap-schema \ No newline at end of file diff --git a/roles/server-sync-whitespace/tasks/main.yml b/roles/server-sync-whitespace/tasks/main.yml index 8578a15..7d71bd1 100644 --- a/roles/server-sync-whitespace/tasks/main.yml +++ b/roles/server-sync-whitespace/tasks/main.yml @@ -143,7 +143,7 @@ # Print some information to the screen ######################################################################## -- debug: - msg: "The sync gate way username is '{{ sync_gateway.user }}' and password '{{ sync_gateway.password }}'" - tags: - - "application" \ No newline at end of file +# - debug: +# msg: "The sync gate way username is '{{ sync_gateway.user }}' and password '{{ sync_gateway.password }}'" +# tags: +# - "application" \ No newline at end of file diff --git a/roles/server-sync-whitespace/templates/index.html.j2 b/roles/server-sync-whitespace/templates/index.html.j2 index ec22dba..fc44f34 100644 --- a/roles/server-sync-whitespace/templates/index.html.j2 +++ b/roles/server-sync-whitespace/templates/index.html.j2 @@ -1,8 +1,8 @@ -{{ ansible_hostname }} +{{ ansible_hostname }} ({{ location }}) -

{{ ansible_hostname }}

+

{{ ansible_hostname }} ({{ location }})

\ No newline at end of file