Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Updated traffic manager config

Retries for WAF on Ansible config
  • Loading branch information...
jvhoof committed Dec 20, 2018
1 parent 2578a5b commit 1007caadaee02750f776d023b0f68b2044eae010
@@ -1,45 +1,45 @@
---
#- hosts: cgf-blue:cgf-green
# gather_facts: no
# roles:
# - role: cgf-bootstrap
#
#- hosts: cgf-blue:cgf-green
# gather_facts: no
# roles:
# - role: cgf-config
- hosts: cgf-blue:cgf-green
gather_facts: no
roles:
- role: cgf-bootstrap

- hosts: cgf-blue:cgf-green
gather_facts: no
roles:
- role: cgf-config

- hosts: web:sql
gather_facts: no
become: yes
become_method: sudo
strategy: free
roles:
- role: common
- role: docker

#- hosts: web:sql
# gather_facts: no
# become: yes
# become_method: sudo
# strategy: free
# roles:
# - role: common
# - role: docker
#
#- hosts: web
# gather_facts: no
# become: yes
# become_method: sudo
# strategy: free
# tasks:
# - include_role:
# name: colors
#
#- hosts: sql
# gather_facts: no
# become: yes
# become_method: sudo
# strategy: free
# tasks:
# - include_role:
# name: sql
#
#- hosts: waf-blue:waf-green
# gather_facts: no
# roles:
# - role: waf-bootstrap
- hosts: web
gather_facts: no
become: yes
become_method: sudo
strategy: free
tasks:
- include_role:
name: colors

- hosts: sql
gather_facts: no
become: yes
become_method: sudo
strategy: free
tasks:
- include_role:
name: sql

- hosts: waf-blue:waf-green
gather_facts: no
roles:
- role: waf-bootstrap

- hosts: waf-blue:waf-green
gather_facts: no
@@ -8,14 +8,13 @@
force_basic_auth: yes
headers:
Content-Type: "application/json"
status_code: 200
register: service
status_code: 200, 404
register: result
ignore_errors: True
#- debug:
# msg: "{{service.json}}"
until: result.status != -1

- name: Create "{{ request_name }}"
when: service is failed
when: result.status == 404
uri:
url: "{{ request_url }}{{ request_path }}"
method: POST
@@ -28,9 +27,11 @@
headers:
Content-Type: "application/json"
status_code: 201
register: result2
until: result2.status != -1

- name: Edit "{{ request_name }}"
when: service is succeeded
when: result.status == 200
uri:
url: "{{ request_url }}{{ request_path }}/{{ request_name }}"
method: PUT
@@ -42,3 +43,5 @@
headers:
Content-Type: "application/json"
status_code: 200
register: result2
until: result2.status != -1
@@ -9,13 +9,14 @@
headers:
Content-Type: "application/json"
status_code: 200
register: service
ignore_errors: True
register: result
until: result.status != -1
#- debug:
# msg: "{{service.json}}"

- name: Create "{{ request_name }}"
when: service is failed
when: result is failed
uri:
url: "{{ request_url }}{{ request_path }}"
method: POST
@@ -28,3 +29,5 @@
headers:
Content-Type: "application/json"
status_code: 201
register: result2
until: result2.status != -1
@@ -16,6 +16,7 @@
Accept: "application/json"
status_code: 200,302
register: result
until: result.status != -1

- name: WAF - Verify if a reboot is performed
when: ( result.status == 302 and result.location | select("match", ".*result\.html.*") )
@@ -11,3 +11,5 @@
headers:
Content-Type: "application/json"
status_code: 200
register: result
until: result.status != -1
@@ -11,3 +11,5 @@
headers:
Content-Type: "application/json"
status_code: 201
register: result
until: result.status != -1
@@ -11,6 +11,7 @@
status_code: 200
register: service
ignore_errors: True

#- debug:
# msg: "{{service.json}}"

@@ -210,11 +210,7 @@ terraform workspace select "trafficmanager" || terraform workspace new "trafficm
echo ""
echo "==> Terraform plan"
echo ""
terraform plan --out "$PLANATM" \
-var "CCSECRET=$CCSECRET" \
-var "PASSWORD=$PASSWORD" \
-var "SSH_KEY_DATA=$SSH_KEY_DATA" \
-var "DEPLOYMENTCOLOR=$DEPLOYMENTCOLOR"
terraform plan --out "$PLANATM"

echo ""
echo "==> Terraform apply"

0 comments on commit 1007caa

Please sign in to comment.
You can’t perform that action at this time.