Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
- sorting end to end deploy
  • Loading branch information
russmckendrick committed Jun 3, 2019
1 parent 3800e90 commit 8f35105
Show file tree
Hide file tree
Showing 56 changed files with 86,892 additions and 81 deletions.
20 changes: 11 additions & 9 deletions group_vars/rm-dev-schemareview.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
---

options:
install_trend: false
bootstrap_database: true
# Some

install_trend: false
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
name: "rm-dev-schemareview" # this can contain characters such as -, don't get too creative though
shortname: "rmdevschem" # all lower-case, all one word
env: "dev"
working_folder: "/wsdocker"

Expand All @@ -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}}]'
Expand All @@ -53,6 +56,7 @@ sync_gateway:
30306563373237346163333039343661376161313462623036373366313962373763366236396462
3131656633303639330a313537343430626436343239383034316637366532663239633930623632
64663135653631613666633535336338343234353531323038626533393062616133
admin_port: "18200"

ssl_cert_pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
Expand Down Expand Up @@ -193,8 +197,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') }}"
32 changes: 30 additions & 2 deletions play-rm-dev-schemareview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,43 @@
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/rm-dev-schemareview.yml
- group_vars/openid-dev.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 (schema)
hosts: localhost
connection: local
gather_facts: true

vars_files:
- group_vars/rm-dev-schemareview.yml
- group_vars/openid-dev.yml

roles:
- roles/server-database-bootstrap
- roles/server-database-bootstrap-schema
File renamed without changes.
53 changes: 53 additions & 0 deletions roles/server-database-bootstrap-schema/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# tasks file for roles/server-database-bootstrap

- name: gather some facts on the public IP address attached to the couchbase load balancer
azure_rm_publicipaddress_facts:
resource_group: "{{ resource_group }}"
name: "{{ vmss_syncgateway.name }}-lb-pip"
register: sg_ip_address
when: bootstrap_database_create_schema == true

- name: gather some facts on the couchbase load balancer
set_fact:
sg_server: "https://{{ sg_ip_address.ansible_facts.azure_publicipaddresses[0].properties.ipAddress }}:{{ sync_gateway.admin_port }}"
when: bootstrap_database_create_schema == true

- name: wait for a minute to couchbase catchup with itself
pause:
minutes: 1
when: bootstrap_database_create_schema == true

- name: users
command: "curl -k {{ sg_server }}{{ couchbase_bootstrap.auth }}/{{ couchbase.bucket }}/_user/public -X PUT -H {{ couchbase_bootstrap.ctaj }} -T files/initialisation/users/{{ item }}"
with_items:
- "publicuser.json"
args:
warn: no
when: bootstrap_database_create_schema == true

- name: corporates
command: "curl -k {{ sg_server }}{{ couchbase_bootstrap.auth }}/{{ couchbase.bucket }}/{{ item }} -X PUT -H {{ couchbase_bootstrap.ctaj }} -T files/initialisation/corporates/{{ item }}"
with_items:
- "Corporate-WSBKR"
args:
warn: no
when: bootstrap_database_create_schema == true

- name: reference
command: "curl -k {{ sg_server }}{{ couchbase_bootstrap.auth }}/{{ couchbase.bucket }}/{{ item }} -X PUT -H {{ couchbase_bootstrap.ctaj }} -T files/initialisation/reference/{{ item }}"
with_items:
- "CDBrokerRemunerationAndDeductionsSynonyms"
- "CDEndorsementSynonyms"
- "CDFiscalAndRegulatorySynonyms"
- "CDInformationSynonyms"
- "CDOtherSynonyms"
- "CDRiskDetailsSynonyms"
- "CDSectionSynonyms"
- "CDSecurityDetailsSynonyms"
- "CDSubscriptionAgreementSynonyms"
- "MRCScanSuggestions"
- "sdccodes"
args:
warn: no
when: bootstrap_database_create_schema == true
38 changes: 38 additions & 0 deletions roles/server-database-bootstrap-user/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Role Name
=========

A brief description of the role goes here.

Requirements
------------

Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.

Role Variables
--------------

A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.

Dependencies
------------

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
roles:
- { role: username.rolename, x: 42 }

License
-------

BSD

Author Information
------------------

An optional section for the role authors to include contact information, or a website (HTML is not allowed).
2 changes: 2 additions & 0 deletions roles/server-database-bootstrap-user/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for roles/server-database-bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"_attachments": {},
"_id": "Corporate-WSBKR",
"admins": [
"[email protected]"
],
"channelPrefix": "wsbkr",
"channels": [
"shared"
],
"companyId": "WSBKR",
"createdAt": "2019-05-23 10:18:00",
"members": [
{
"currentState": "",
"email": "[email protected]",
"name": "Jody Wilkinson",
"teams": [
"ALL"
],
"uniqueID": "MU8A0F9072-3EAC-4864-AFEE-7668BE563060"
},
{
"currentState": "",
"email": "[email protected]",
"name": "Russ McKendrick",
"teams": [
"ALL"
],
"uniqueID": "MU8A0F9072-3EAC-4864-AFEE-7668BE563061"
}
],
"name": "Whitespace Broking",
"role": "broker",
"stamps": [],
"teams": [
{
"channel": "wsbkr_ALL",
"name": "All Risks",
"teamId": "ALL"
}
],
"type": "CorporateDetail",
"updatedAt": "2019-05-23 10:18:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if test "$1" == "" ; then
echo doone.sh docID
exit
fi
curl -k $AURL/$BUCKET/$1 -X PUT -H $CTAJ -T $1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sh doone.sh Corporate-WSBKR

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Commission": [
"AON Carrier Commission"
],
"TotalBrokerage": [
"Brokerage"
],
"channels": [
"shared"
],
"createdAt": "2017-02-24 16:43:00",
"type": "ContractDrafterSetting"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"EndorsementReference": [
"Broker Endorsement Reference"
],
"EndorsementName": [
"Broker Endorsement Name"
],
"EndorsementEffectiveDate": [
"Effective Date",
"Broker Endorsement Effective Date",
"Broker Effective Date"
],
"channels": [
"shared"
],
"EndorsementNumber": [
"Broker Endorsement Number"
],
"type": "ContractDrafterSetting",
"createdAt": "2017-10-24 14:36:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"SurplusLinesBroker": [
"Surplus line broker"
],
"CountryOfOrigin": [],
"type": "ContractDrafterSetting",
"AllocationOfPremiumToCoding": [
"Allocation Of Premium Coding"
],
"channels": [
"shared"
],
"AllocationOfPremiumToYearsOfAccount": [
"Allocation of premium to year",
"Allocation of Premium to year of Account"
],
"TaxPayableByInsurers": [
"Tax Payable by Underwriter(s)",
"TAX PAYABLE BY REINSURER(S)",
"Taxes Payable by Insurers(s)",
"Taxes Payable by Insurer(s)",
"TAXES PAYABLE BY REINSURERS"
],
"IsTheBusinessSubjectToDistanceMarketingDirective": [
"Is Business Subject To Distance Marketing Directive Rules"
],
"USClassification": [
"US Classification:(for Lloyd’s use only)"
],
"createdAt": "2017-02-24 12:37:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"channels": [
"shared"
],
"type": "ContractDrafterSetting",
"createdAt": "2017-02-24 16:43:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"NonMRCHeading": [
"Schedule",
"Professional Indemnity Design & Construct",
"Contract Administration and Advisory Sections",
"NEW YORK SURPLUS LINES NOTICE",
"EURO CONTRACT CONTINUITY CLAUSE",
"SANCTION LIMITATION AND EXCLUSION CLAUSE",
"CLAIMS CONTROL CLAUSE – 1/1/97 – NMA2738",
"NOTICE TO THE INSURED",
"OKLAHOMA SURPLUS LINES NOTICE",
"NB Underlying Policy(ies) limits",
"EXCESS ERRORS AND OMISSIONS LIABILITY INSURANCE",
"BESPOKE OR AMENDED WORDING AND CLAUSES WORDING SCHEDULE(S) AND/OR DECLARATIONS AND ANY OTHER ATTACHMENTS AS APPROPRIATE",
"CONTINGENT EXCESS EMPLOYERS LIABILITY",
"CONTINGENT EXCESS MOTOR LIABILITY",
"Business",
"Indemnity Limits",
"policy number",
"CYBER ATTACK EXCLUSION CLAUSE",
"NOTICE OF CLAIM",
"RISK LOCATION",
"Premium Deductions",
"Premium Deduction",
"All other terms and conditions remain unchanged",
"Whitespace Platform Data",
"Premium Annual and Pro Rata",
"INSURING CLAUSE",
"follow form wording",
"SCHEDULE OF UNDERLYING AMOUNTS",
"NON-PROPORTIONAL FACULTATIVE REINSURANCE",
"Safeguard",
"Contract Changes",
"Comtech Policy",
"Comtech Policy Insurance for technology and telecommunication companies",
"PREMIUM PAYMENT CLAUSE",
"PRIOR ACTS EXCLUSION",
"WORDING AMENDMENTS",
"CLAIMS COOPERATION CLAUSE – LA POSITIVA SEGUROS",
"PROPORTIONAL FACULTATIVE REINSURANCE CLAUSE (LM1)",
"WAR AND TERRORISM EXCLUSION",
"NUCLEAR/CHEMICAL/BIOLOGICAL TERRORISM EXCLUSION",
"MEDICAL EXPENSES EXTENSION",
"PREMIUM COLLECTION CLAUSE",
"LOW CLAIMS BONUS",
"Total of Underlying Limits of Liability"
],
"channels": [
"shared"
],
"ImplyContractType": [
"Marine",
"Indemnity",
"Kidnap",
"Cyber",
"Terrorism"
],
"type": "ContractDrafterSetting",
"createdAt": "2017-02-24 16:43:00"
}
Loading

0 comments on commit 8f35105

Please sign in to comment.