File ardana-cluster-9.0+git.1585653734.c1fe3b2.obscpio of Package ardana-cluster

07070100000000000081A40000000000000000000000015E8327E60000007A000000000000000000000000000000000000003500000000ardana-cluster-9.0+git.1585653734.c1fe3b2/.gitreview[gerrit]
host=gerrit.prv.suse.net
port=29418
project=ardana/cluster-ansible.git
defaultremote=ardana
defaultbranch=master
07070100000001000081A40000000000000000000000015E8327E60000000C000000000000000000000000000000000000003800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/.rsync-filter- ardana-ci
07070100000002000081A40000000000000000000000015E8327E6000004FC000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-deploy.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: FND-AP2
  roles:
    - FND-AP2
  tasks:
    - include: roles/FND-AP2/tasks/install.yml
    - include: roles/FND-AP2/tasks/configure.yml
#
# This is commented out as we remove apache start from deploy. This seems a bit
# odd but after intitial deploy there is no apache configuration in place and
# therefore apache cannot be started. The first service in should therefore
# start apache instead of it being started here.
#
# Start depends on a notification from above
# split it out to make sure the handler fires first
#- hosts: FND-AP2
#  roles:
#    - FND-AP2
#  tasks:
#    - include: roles/FND-AP2/tasks/start.yml
07070100000003000081A40000000000000000000000015E8327E6000002E7000000000000000000000000000000000000004300000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-post-upgrade.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  roles:
  - FND-AP2

  tasks:
  - include: roles/FND-AP2/tasks/post-upgrade.yml

07070100000004000081A40000000000000000000000015E8327E6000002E6000000000000000000000000000000000000004200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-pre-upgrade.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  roles:
  - FND-AP2

  tasks:
  - include: roles/FND-AP2/tasks/pre-upgrade.yml

07070100000005000081A40000000000000000000000015E8327E6000003E0000000000000000000000000000000000000004200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-reconfigure.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  roles:
    - FND-AP2
  tasks:
    - include: roles/FND-AP2/tasks/configure.yml

# Start depends on a notification from above
# split it out to make sure the handler fires first
- hosts: FND-AP2
  roles:
    - FND-AP2
  serial: 1
  tasks:
    - include: roles/FND-AP2/tasks/start.yml
    - include: roles/FND-AP2/tasks/status.yml
07070100000006000081A40000000000000000000000015E8327E60000055F000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-remove.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: FND-AP2
  roles:
    - FND-AP2
  tasks:
    - name: |
        You will permanently wipe apache from your system if you continue.
        This will remove all apache data from all the nodes.
      delegate_to: localhost
      pause:
        prompt: |
          Wipe apache from the system ?
          Press enter to continue or control+c then a to abort
      when: automate is not defined

    - name: |
        5 minutes to reconsider. press ctrl+c then c if you are sure.
        if not press ctrl+c then a to abort.
      delegate_to: localhost
      pause:
        minutes: 5
      when: automate is not defined

    - include: roles/FND-AP2/tasks/remove_packages.yml
    - include: roles/FND-AP2/tasks/remove_dirs.yml
07070100000007000081A40000000000000000000000015E8327E60000028B000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-restart.yml#
# (c) Copyright 2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: _FND-AP2-schedule-restart.yml

- include: FND-AP2-start.yml
07070100000008000081A40000000000000000000000015E8327E6000002E0000000000000000000000000000000000000003C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-start.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  roles:
  - FND-AP2

  tasks:
  - include: roles/FND-AP2/tasks/start.yml

07070100000009000081A40000000000000000000000015E8327E6000002FA000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-status.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  max_fail_percentage: 0
  roles:
  - FND-AP2

  tasks:
  - include: roles/FND-AP2/tasks/status.yml

0707010000000A000081A40000000000000000000000015E8327E6000002DF000000000000000000000000000000000000003B00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-stop.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  roles:
  - FND-AP2

  tasks:
  - include: roles/FND-AP2/tasks/stop.yml

0707010000000B000081A40000000000000000000000015E8327E600000478000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-upgrade.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  roles:
    - FND-AP2
  tasks:
    - include: roles/FND-AP2/tasks/status.yml
    - include: roles/FND-AP2/tasks/check_upgraded_pkgs.yml
    - include: roles/FND-AP2/tasks/install.yml
    - include: roles/FND-AP2/tasks/configure.yml

# Start depends on a notification from above
# split it out to make sure the handler fires first
- hosts: FND-AP2
  roles:
    - FND-AP2
  serial: 1
  tasks:
    - include: roles/FND-AP2/tasks/start.yml
    - include: roles/FND-AP2/tasks/status.yml
0707010000000C000081A40000000000000000000000015E8327E6000002AF000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-AP2-vhosts-transition.yml#
# (c) Copyright 2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-AP2
  roles:
    - FND-AP2
  tasks:
    - include: roles/FND-AP2/tasks/vhosts-transition.yml
0707010000000D000081A40000000000000000000000015E8327E6000002F4000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-configure-monasca.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- include: _haproxy-configure-monasca.yml

#Note: Add monasca config of other sub-services, eg keepalived here.
0707010000000E000081A40000000000000000000000015E8327E600000482000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-deploy.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  roles:
    - FND-CLU
    - haproxy
    - keepalived
  tasks:
    - include: roles/haproxy/tasks/install.yml
    - include: roles/haproxy/tasks/stop.yml
    - include: roles/haproxy/tasks/configure.yml
    - include: roles/haproxy/tasks/start.yml

    - include: roles/keepalived/tasks/install.yml
    - include: roles/keepalived/tasks/stop.yml
    - include: roles/keepalived/tasks/configure.yml
    - include: roles/keepalived/tasks/start.yml

- include: FND-CLU-configure-monasca.yml
0707010000000F000081A40000000000000000000000015E8327E60000031C000000000000000000000000000000000000004300000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-post-upgrade.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  roles:
  - FND-CLU

  tasks:
  - include: roles/haproxy/tasks/post-upgrade.yml
  - include: roles/keepalived/tasks/post-upgrade.yml

07070100000010000081A40000000000000000000000015E8327E60000031A000000000000000000000000000000000000004200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-pre-upgrade.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  roles:
  - FND-CLU

  tasks:
  - include: roles/haproxy/tasks/pre-upgrade.yml
  - include: roles/keepalived/tasks/pre-upgrade.yml

07070100000011000081A40000000000000000000000015E8327E600000464000000000000000000000000000000000000004200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-reconfigure.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  roles:
  - FND-CLU

  tasks:
  - include: roles/haproxy/tasks/configure.yml
  - include: roles/keepalived/tasks/configure.yml

# split out start to make sure a handler has fired

- hosts: FND-CLU
  roles:
  - FND-CLU
  serial: 1

  tasks:
  - include: roles/haproxy/tasks/start.yml
  - include: roles/keepalived/tasks/start.yml
  - include: roles/haproxy/tasks/status.yml
  - include: roles/keepalived/tasks/status.yml

- include: FND-CLU-configure-monasca.yml
07070100000012000081A40000000000000000000000015E8327E600000621000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-remove.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: FND-CLU
  roles:
    - FND-CLU
    - haproxy
    - keepalived
  tasks:
    - name: |
        You will permanently wipe haproxy and keepalived from your system if
        you continue. This will remove all haproxy and keepalived from all the
        nodes.
      delegate_to: localhost
      pause:
        prompt: |
          Wipe haproxy and keepalived from the system ?
          Press enter to continue or control+c then a to abort
      when: automate is not defined

    - name: |
        5 minutes to reconsider. press ctrl+c then c if you are sure.
        if not press ctrl+c then a to abort.
      delegate_to: localhost
      pause:
        minutes: 5
      when: automate is not defined

    - include: roles/haproxy/tasks/remove_packages.yml
    - include: roles/haproxy/tasks/remove_dirs.yml
    - include: roles/keepalived/tasks/remove_packages.yml
    - include: roles/keepalived/tasks/remove_dirs.yml
07070100000013000081A40000000000000000000000015E8327E60000028B000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-restart.yml#
# (c) Copyright 2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: _FND-CLU-schedule-restart.yml

- include: FND-CLU-start.yml
07070100000014000081A40000000000000000000000015E8327E600000328000000000000000000000000000000000000003C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-start.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  roles:
  - FND-CLU
  - haproxy
  - keepalived

  tasks:
  - include: roles/haproxy/tasks/start.yml
  - include: roles/keepalived/tasks/start.yml
07070100000015000081A40000000000000000000000015E8327E600000343000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-status.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  max_fail_percentage: 0
  roles:
  - FND-CLU
  - haproxy
  - keepalived

  tasks:
  - include: roles/haproxy/tasks/status.yml
  - include: roles/keepalived/tasks/status.yml
07070100000016000081A40000000000000000000000015E8327E600000326000000000000000000000000000000000000003B00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-stop.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  roles:
  - FND-CLU
  - haproxy
  - keepalived

  tasks:
  - include: roles/haproxy/tasks/stop.yml
  - include: roles/keepalived/tasks/stop.yml
07070100000017000081A40000000000000000000000015E8327E600000596000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/FND-CLU-upgrade.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU
  roles:
  - FND-CLU

  tasks:
  - include: roles/haproxy/tasks/status.yml
  - include: roles/keepalived/tasks/status.yml
  - include: roles/haproxy/tasks/check_upgraded_pkgs.yml
  - include: roles/keepalived/tasks/check_upgraded_pkgs.yml
  - include: roles/haproxy/tasks/install.yml
  - include: roles/keepalived/tasks/install.yml
  - include: roles/haproxy/tasks/configure.yml
  - include: roles/keepalived/tasks/configure.yml

# split out start to make sure a handler has fired

- hosts: FND-CLU
  roles:
  - FND-CLU
  serial: 1

  tasks:
  - include: roles/haproxy/tasks/start.yml
  - include: roles/keepalived/tasks/start.yml
  - include: roles/haproxy/tasks/status.yml
  - include: roles/keepalived/tasks/status.yml

- include: FND-CLU-configure-monasca.yml
07070100000018000081A40000000000000000000000015E8327E60000279F000000000000000000000000000000000000003200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/LICENSE
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

07070100000019000081A40000000000000000000000015E8327E600000B92000000000000000000000000000000000000003400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/README.md
(c) Copyright 2015 Hewlett Packard Enterprise Development LP
(c) Copyright 2017 SUSE LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.


README
======

This repo contains the following roles:
- FND-CLU: cluster role, which has no tasks but depends on the following two
  roles.
- haproxy: haproxy role
- keepalived: keepalived role
- FND-AP2: Apache role
- cluster-lifecycle: this role is currently empty, save for vars/main.yml

The verbs:
- install
- configure
- start
- stop

The operations:
- deploy

TODO: Separate haproxy, keepalived and FND-AP2 into their own repos
TODO: Rename FND-CLU and FND-AP2 when CP supports non-mnemonic names.

These roles are relatively simple.
Two top level playbooks - FND-CLU-deploy.yml and
FND-AP2-deploy.yml - deploy the services.

Repo structure:

```
├── FND-AP2-deploy.yml
├── FND-CLU-deploy.yml
├── README.md
└── roles
    ├── cluster-lifecycle
    │   ├── defaults
    │   │   └── dummy
    │   ├── files
    │   │   └── dummy
    │   ├── handlers
    │   │   └── dummy
    │   ├── meta
    │   │   └── dummy
    │   ├── tasks
    │   ├── templates
    │   │   └── dummy
    │   └── vars
    │       ├── dummy
    │       └── main.yml
    ├── FND-AP2
    │   ├── defaults
    │   │   └── main.yml
    │   └── tasks
    │       ├── configure.yml
    │       ├── install.yml
    │       ├── start.yml
    │       └── stop.yml
    ├── FND-CLU
    │   ├── meta
    │   │   └── main.yml
    │   └── README
    ├── haproxy
    │   ├── files
    │   │   └── enable_nonlocal_binding
    │   ├── README
    │   ├── tasks
    │   │   ├── configure.yml
    │   │   ├── install.yml
    │   │   ├── start.yml
    │   │   └── stop.yml
    │   ├── templates
    │   │   └── haproxy.cfg
    │   └── vars
    │       └── main.yml
    └── keepalived
        ├── tasks
        │   ├── configure.yml
        │   ├── install.yml
        │   ├── start.yml
        │   └── stop.yml
        └── templates
            └── keepalived.conf

```
0707010000001A000081A40000000000000000000000015E8327E6000002D3000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/_FND-AP2-schedule-restart.yml#
# (c) Copyright 2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# Schedule a restart of apache using ardana_notify_... variables
- hosts: all
  tasks:
    - include: roles/FND-AP2/tasks/_schedule_restart.yml0707010000001B000081A40000000000000000000000015E8327E6000002D9000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/_FND-CLU-schedule-restart.yml#
# (c) Copyright 2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# Schedule a restart of all services using ardana_notify_... variables
- hosts: all
  tasks:
    - include: roles/FND-CLU/tasks/_schedule_restart.yml0707010000001C000081A40000000000000000000000015E8327E60000032A000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/_haproxy-configure-monasca.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- hosts: FND-CLU:&MON-AGN
  gather_facts: no
  max_fail_percentage: 0
  roles:
  - haproxy-monasca

  tasks:
    - include: roles/haproxy-monasca/tasks/configure.yml
0707010000001D000041ED0000000000000000000000045E8327E600000000000000000000000000000000000000000000003400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci0707010000001E000041ED0000000000000000000000035E8327E600000000000000000000000000000000000000000000003C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/project0707010000001F000041ED0000000000000000000000035E8327E600000000000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/project/input-model07070100000020000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/project/input-model/data07070100000021000081A40000000000000000000000015E8327E60000092A000000000000000000000000000000000000005F00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/project/input-model/data/control_plane.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  control-planes:
    - name: cp1
      control-plane-prefix: cp1
      failure-zones:
        - AZ1

      common-service-components:
        - lifecycle-manager-target
      load-balancers:
        - provider: ip-cluster
          name: lb
          components:
            - default
          roles:
            - internal
            - admin
        - provider: ip-cluster
          name: extlb
          external-name: myardana-cp1.test
          components:
            - default
          roles:
            - public
      clusters:
        - name: cluster0
          cluster-prefix: c0
          server-role:
            - SERVER1-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - lifecycle-manager-target
            - lifecycle-manager
            - rabbitmq
            - keystone-api
            - mysql
            - ip-cluster
    - name: cp2
      uses:
        - from: cp1
          service-components:
            - all
      control-plane-prefix: cp2
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
      common-service-components:
        - lifecycle-manager-target
      load-balancers:
        - provider: ip-cluster
          name: lb
          components:
            - default
          roles:
            - internal
            - admin

      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER2-ROLE
            - SERVER3-ROLE
            - SERVER4-ROLE
          member-count: 2
          allocation-policy: strict
          service-components:
            - ntp-server
            - ip-cluster
            - apache2
07070100000022000081A40000000000000000000000015E8327E600000519000000000000000000000000000000000000006000000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/project/input-model/data/network_groups.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  network-groups:
    - name: ARDANA
      hostname-suffix: ardana
      component-endpoints:
        - lifecycle-manager
        - lifecycle-manager-target


    - name: MANAGEMENT
      hostname-suffix: mgmt
      hostname: true

      tags:
        - neutron.networks.vxlan
        - neutron.networks.vlan:
            provider-physical-network: physnet1

#      tls-component-endpoints:
#        - barbican-api
      component-endpoints:
        - default

#      routes:
#        - default

      load-balancers:
        - lb
        - extlb

    - name: EXTERNAL-VM
      tags:
        - neutron.l3_agent.external_network_bridge
07070100000023000081A40000000000000000000000015E8327E600000378000000000000000000000000000000000000005900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/project/input-model/data/regions.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  regions:
    - name: region1
      includes:
        - control-plane: cp1
          services:
            - all

    - name: region2
      includes:
        - control-plane: cp2
          services:
            - all
07070100000024000081A40000000000000000000000015E8327E6000006C3000000000000000000000000000000000000005900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/project/input-model/data/servers.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  baremetal:
    netmask: 255.255.255.0
    subnet: 192.168.110.0
    server-interface: eth2

  servers:

    - id: server1
      ip-addr: 192.168.110.3
      role: SERVER1-ROLE
      server-group: RACK1
      mac-addr: a4:93:0c:4f:7c:73
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.3
      ilo-password: password
      ilo-user: admin

    - id: server2
      ip-addr: 192.168.110.4
      role: SERVER2-ROLE
      server-group: RACK1
      mac-addr: b2:72:8d:ac:7c:6f
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.4
      ilo-password: password
      ilo-user: admin

    - id: server3
      ip-addr: 192.168.110.5
      role: SERVER3-ROLE
      server-group: RACK2
      mac-addr: 8a:8e:64:55:43:76
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.5
      ilo-password: password
      ilo-user: admin

    - id: server4
      ip-addr: 192.168.110.6
      role: SERVER4-ROLE
      server-group: RACK3
      mac-addr: 9a:9e:64:55:43:67
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.5
      ilo-password: password
      ilo-user: admin
07070100000025000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests07070100000026000081ED0000000000000000000000015E8327E6000005CF000000000000000000000000000000000000004D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/add-node-test.bash#!/bin/bash
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

# $1 server id
# $2 ip-addr
# $3 role
# $4 server-group
# $5 mac-addr
# $6 ilo-ip
# $7 cluster-name
cat <<EOF >> ~/openstack/my_cloud/definition/data/servers.yml
    - id: $1
      ip-addr: $2
      role: $3
      server-group: $4
      mac-addr: $5
      nic-mapping: VAGRANT
      ilo-ip: $6
      ilo-password: password
      ilo-user: admin
EOF

controlplane=~/openstack/my_cloud/definition/data/control_plane.yml
membercount=`grep -nA 10 "$7" $controlplane | grep "member-count:" | cut -d ':' -f2 | xargs`
linenum=`grep -nA 10 "$7" $controlplane | grep "member-count:" | cut -f1 -d"-"`
sed -i ''$linenum's/member-count: '$membercount'/member-count: '$((membercount + 1))'/' $controlplane

serverrole=`grep -nA 10 "$7" $controlplane | grep "server-role:" | cut -f1 -d"-"`
sed -i ''$serverrole' a\
            - '$3'' $controlplane
07070100000027000081A40000000000000000000000015E8327E60000059B000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/change-repo.yml#
# (c) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: RUN-HOSTS
  tasks:
  - name: create 192_168_10_3_79_ardana_sources.list
    become: yes
    file:
      path: /etc/apt/sources.list.d/192_168_10_3_79_ardana_sources.list
      state: touch

  - name: change apt-repo
    become: yes
    lineinfile:
      dest: /etc/apt/sources.list.d/192_168_10_3_79_ardana_sources.list
      line: "deb [arch=amd64] http://apt.suse.provo.cloud/apt/hlinux-deejay.us.rdlabs.hpecorp.net/hLinuxArchive/{{ repo }} cattleprod main contrib non-free"

  - name: install aptitude
    become: yes
    apt:
      name: aptitude
      update_cache: yes

# module version of this seems a no-op.  maybe https://github.com/ansible/ansible-modules-core/issues/1497
  - name: update and upgrade apt packages
    become: yes
    shell: sudo apt-get update

07070100000028000081A40000000000000000000000015E8327E60000049B000000000000000000000000000000000000004D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/cleanup-python.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

# This allows a downgrade of python to happen also
- hosts: RUN-HOSTS
  tasks:
  -  name: cleanup-python | force install python version
     apt: >
       pkg={{ item }}
       state=present
       force=yes
     with_items:
       - python2.7="{{ python_version_available }}"
       - python2.7-minimal="{{ python_version_available }}"
       - libpython2.7-stdlib="{{ python_version_available }}"
       - libpython2.7-minimal="{{ python_version_available }}"
       - libpython2.7="{{ python_version_available }}"
     become: yes

07070100000029000081A40000000000000000000000015E8327E6000002F2000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/cleanup.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: RUN-HOSTS
  tasks:
  - name: remove aptsave directory
    become: yes
    shell:  rm -rf /etc/aptsave
0707010000002A000081ED0000000000000000000000015E8327E6000004D0000000000000000000000000000000000000004400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/copy.bash#!/bin/bash
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

# $1 playbook name
# $2 can be limit or extra var
# $3 will be extra var when $2 is set
cp ~/ardana-ci-tests/$1 ~/scratch/ansible/next/ardana/ansible
if [ -n "$3" ]
then
  ansible-playbook -i hosts/verb_hosts $1 $2 -e $3
  status=$?
else
  if [ -n "$2" ];
  then
    if [[ $2 == *"limit"* ]]
    then
      ansible-playbook -i hosts/verb_hosts $1 $2
      status=$?
    else
      ansible-playbook -i hosts/verb_hosts $1 -e $2
      status=$?
    fi
  else
    ansible-playbook -i hosts/verb_hosts $1
    status=$?
  fi
fi
rm ~/scratch/ansible/next/ardana/ansible/$1
exit $status
0707010000002B000081ED0000000000000000000000015E8327E600000359000000000000000000000000000000000000005200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/create-apache-conf.bash#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#!/bin/bash
cp ~/ardana-ci-tests/create-apache-conf.yml ~/scratch/ansible/next/ardana/ansible
ansible-playbook -i hosts/verb_hosts create-apache-conf.yml
rm ~/scratch/ansible/next/ardana/ansible/create-apache-conf.yml
0707010000002C000081A40000000000000000000000015E8327E60000033A000000000000000000000000000000000000005100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/create-apache-conf.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
- include: FND-AP2-reconfigure.yml
  vars:
    host:
      vars:
    FND_AP2_sites_enabled:
      test.conf:
        listen: "*"
        port: "80"
        document_root: "/var/www/html"
0707010000002D000081A40000000000000000000000015E8327E600000356000000000000000000000000000000000000005A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/create-apache-deployer-conf.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
- include: FND-AP2-reconfigure.yml
  vars:
    host:
      vars:
    FND_AP2_sites_enabled:
      deployer_venv_server.conf:
        listen: "*"
        port: "79"
        document_root: "/opt/ardana_packager"
0707010000002E000081ED0000000000000000000000015E8327E60000029B000000000000000000000000000000000000004C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/disable-site.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
sudo a2dissite $1
0707010000002F000081A40000000000000000000000015E8327E60000033E000000000000000000000000000000000000004B00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/install-snmp.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: FND-CLU
  tasks:
  - name: workaround, install snmp
    apt:
      name: "{{ item}}"
      state: present
      force: yes
    with_items:
      - libsnmp30
    become: yes
07070100000030000081A40000000000000000000000015E8327E6000003DD000000000000000000000000000000000000005000000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/move-sources.list.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: RUN-HOSTS
  tasks:
  - stat:
      path: /etc/aptsave
    become: yes
    register: mysave
  - name: create aptsave directory
    become: yes
    file:
      path: /etc/aptsave
      state: directory
    when: mysave.stat.exists == False
  - name: move sources.list
    become: yes
    shell: mv /etc/apt/sources.list.d/* /etc/aptsave/

07070100000031000081A40000000000000000000000015E8327E6000003CF000000000000000000000000000000000000004D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/pwd_change_cp1.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
keepalive_vrrp_password:
  value: "mynewpassword"
  metadata:
  - clusters:
    - cluster0
    component: ip-cluster
    consuming-cp: cp1
    cp: cp1
  version: '2.0'

haproxy_stats_password:
  value: "mynewpassword"
  metadata:
  - clusters:
    - cluster0
    component: ip-cluster
    consuming-cp: cp1
    cp: cp1
  version: '2.0'
07070100000032000081ED0000000000000000000000015E8327E600000486000000000000000000000000000000000000005000000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/remove-node-test.bash#!/bin/bash
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

# $1 is server name
# $2 is server role
# $3 is cluster name

controlplane=~/openstack/my_cloud/definition/data/control_plane.yml
sed -i '/id: '$1'/,+9d' ~/openstack/my_cloud/definition/data/servers.yml
sed -i '/'$2'/d' $controlplane
membercount=`grep -nA 10 "$3" $controlplane | grep "member-count:" | cut -d ':' -f2 | xargs`
linenum=`grep -nA 10 "$3" $controlplane | grep member-count | cut -f1 -d"-"`
sed -i ''$linenum's/member-count: '$membercount'/member-count: '$((membercount - 1))'/' $controlplane
07070100000033000081A40000000000000000000000015E8327E6000003BD000000000000000000000000000000000000005200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/remove-sources.list.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: RUN-HOSTS
  tasks:
  - name: remove sources.list
    become: yes
    shell:  rm /etc/apt/sources.list.d/*

# module version of this seems a no-op.  maybe https://github.com/ansible/ansible-modules-core/issues/1497
  - name: update and upgrade apt packages
    become: yes
    shell: sudo apt-get update


07070100000034000081A40000000000000000000000015E8327E6000003EA000000000000000000000000000000000000005300000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/restore-sources.list.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: RUN-HOSTS
  tasks:
  - name: restore sources.list
    become: yes
    shell: rm -rf /etc/apt/sources.list.d/* ; cp -r  /etc/aptsave/* /etc/apt/sources.list.d/
# module version of this seems a no-op.  maybe https://github.com/ansible/ansible-modules-core/issues/1497
  - name: update and upgrade apt packages
    become: yes
    shell: apt-get update
07070100000035000081ED0000000000000000000000015E8327E6000003B2000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/run-cp.bash#!/bin/bash
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

cd ~/openstack/ardana/ansible
git add -A
git commit -m "My config or other commit message"
ansible-playbook -i hosts/localhost config-processor-run.yml -e remove_deleted_servers="y" -e free_unused_addresses="y" -e encrypt="" -e rekey=""
ansible-playbook -i hosts/localhost ready-deployment.yml
07070100000036000081ED0000000000000000000000015E8327E6000002BB000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/test-conf.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
set -evx
echo "$1 $2"
sudo grep "$1" "$2"
exit $?
07070100000037000081A40000000000000000000000015E8327E600004676000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/test-plan.yaml#
# (c) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# note: aptitude is not installed at this point and is installed as part of these tests

- name: get apache version
  exec:
    - echo `/usr/bin/apt-cache policy apache2-bin |grep Installed |awk '{print "apache2-bin " $2}'` >/tmp/cluversions

- name: get haproxy version
  exec:
    - echo `/usr/bin/apt-cache policy haproxy |grep Installed |awk '{print "haproxy " $2}'` >>/tmp/cluversions

- name: get keepalived version
  exec:
    - echo ` /usr/bin/apt-cache policy keepalived |grep Installed |awk '{print "keepalived " $2}'` >>/tmp/cluversions

- name: remove-apache
  logfile: testsuite-remove.log
  prefix: remove
  playbooks:
    - FND-AP2-remove.yml -e automate=true

- name: move apt repos
  logfile: testsuite-remove.log
  prefix: move
  exec:
    - sed -e 's/RUN-HOSTS/FND-AP2/g' -i ~/ardana-ci-tests/move-sources.list.yml
    - copy.bash move-sources.list.yml
    - sed -e 's/FND-AP2/RUN-HOSTS/g' -i ~/ardana-ci-tests/move-sources.list.yml

- name: update apt repo
  logfile: testsuite-upgrade.log
  prefix: remove
  exec:
    - sed -e 's/RUN-HOSTS/FND-AP2/g' -i ~/ardana-ci-tests/change-repo.yml
    - copy.bash change-repo.yml repo=2016/ardana4.0_alpha-3
    - sed -e 's/FND-AP2/RUN-HOSTS/g' -i ~/ardana-ci-tests/change-repo.yml

# This cleanups python and force installs the version in the older repo
# to facilitate downgrade for this test
- name: cleanup-python
  logfile: testsuite-remove.log
  prefix: cleanup-python
  exec:
    - sed -e 's/RUN-HOSTS/FND-AP2/g' -i ~/ardana-ci-tests/cleanup-python.yml
    - copy.bash cleanup-python.yml python_version_available=2.7.9-2
    - sed -e 's/RUN-HOSTS/FND-AP2/g' -i ~/ardana-ci-tests/cleanup-python.yml

- name: deploy apache ardana4.0_alpha-3
  logfile: testsuite-upgrade.log
  prefix: deploy-early-apache
  playbooks:
    - FND-AP2-deploy.yml

- name: Create Deployer site info
  logfile: testsuite-enablesite.log
  prefix: enablesite
  exec:
    - copy.bash create-apache-deployer-conf.yml

- name: test apache version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-version.bash apache2-bin  2.4.10-10+deb8u1

- name: change apt-repo
  logfile: testsuite-upgrade.log
  prefix: change-apt-repo
  exec:
    - sed -e 's/RUN-HOSTS/FND-AP2/g' -i ~/ardana-ci-tests/restore-sources.list.yml
    - copy.bash restore-sources.list.yml
    - sed -e 's/FND-AP2/RUN-HOSTS/g' -i ~/ardana-ci-tests/restore-sources.list.yml

- name: test major pre upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-AP2-pre-upgrade.yml --limit *c0*

- name: Run base upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - _ardana-upgrade-base.yml --limit *c0*

- name: test  upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-AP2-upgrade.yml --limit *c0*

- name: test major post upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-AP2-post-upgrade.yml --limit *c0*

# Look for apache2-bin to avoid apache lib stuff
- name: test apache version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-orig-version.bash apache2-bin

- name: test major pre upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-AP2-pre-upgrade.yml

- name: Run base upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - _ardana-upgrade-base.yml

- name: test  upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-AP2-upgrade.yml

# Look for apache2-bin to avoid apache lib stuff
- name: test apache version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-orig-version.bash apache2-bin

- name: test major post upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-AP2-post-upgrade.yml

# Now test FND-CLU - haproxy test

- name: remove-cluster
  logfile: testsuite-remove.log
  prefix: remove
  playbooks:
    - FND-CLU-remove.yml -e automate=true

#This is a workaround for missing dependency for keepalived
# in earlier kits.
- name: workaround-install-snmp
  logfile: testsuite-remove.log
  prefix: workaround-install-snmp
  exec:
    - copy.bash install-snmp.yml

- name: move apt repos
  logfile: testsuite-remove.log
  prefix: move
  exec:
    - sed -e 's/RUN-HOSTS/FND-CLU/g' -i ~/ardana-ci-tests/move-sources.list.yml
    - copy.bash move-sources.list.yml
    - sed -e 's/FND-CLU/RUN-HOSTS/g' -i ~/ardana-ci-tests/move-sources.list.yml

- name: update apt repo
  logfile: testsuite-upgrade.log
  prefix: remove
  exec:
    - sed -e 's/RUN-HOSTS/FND-CLU/g' -i ~/ardana-ci-tests/change-repo.yml
    - copy.bash change-repo.yml repo=2016/ardana4.0_alpha-3
    - sed -e 's/FND-CLU/RUN-HOSTS/g' -i  ~/ardana-ci-tests/change-repo.yml

- name: deploy cluster ardana4.0_alpha-3
  logfile: testsuite-upgrade.log
  prefix: deploy-early-cluster
  playbooks:
    - FND-CLU-deploy.yml

- name: test haproxy version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-orig-version.bash keepalived
    - validate-version.bash haproxy 1.5.8-3+deb8u1

- name: change apt-repo
  logfile: testsuite-upgrade.log
  prefix: change-apt-repo
  exec:
    - sed -e 's/RUN-HOSTS/FND-CLU/g' -i ~/ardana-ci-tests/restore-sources.list.yml
    - copy.bash restore-sources.list.yml
    - sed -e 's/FND-CLU/RUN-HOSTS/g' -i ~/ardana-ci-tests/restore-sources.list.yml

- name: test major pre upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-pre-upgrade.yml --limit *c0*

- name: Run base upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - _ardana-upgrade-base.yml --limit *c0*

- name: test  upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-upgrade.yml --limit *c0*

- name: test major post upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-post-upgrade.yml --limit *c0*

# This is  testing haproxy upgrade
- name: test haproxy version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-orig-version.bash keepalived
    - validate-orig-version.bash haproxy

# Now test FND-CLU - keepalived test

- name: remove-cluster
  logfile: testsuite-remove.log
  prefix: remove
  playbooks:
    - FND-CLU-remove.yml -e automate=true

#This is a workaround for missing dependency for keepalived
# in earlier kits.
- name: workaround-install-snmp
  logfile: testsuite-remove.log
  prefix: workaround-install-snmp
  exec:
    - copy.bash install-snmp.yml

- name: remove apt repos
  logfile: testsuite-remove.log
  prefix: remove
  exec:
    - sed -e 's/RUN-HOSTS/FND-CLU/g' -i ~/ardana-ci-tests/remove-sources.list.yml
    - copy.bash remove-sources.list.yml
    - sed -e 's/FND-CLU/RUN-HOSTS/g' -i ~/ardana-ci-tests/remove-sources.list.yml

- name: update apt repo
  logfile: testsuite-upgrade.log
  prefix: remove
  exec:
    - sed -e 's/RUN-HOSTS/FND-CLU/g' -i ~/ardana-ci-tests/change-repo.yml
    - copy.bash change-repo.yml repo=2014/repo.2014-11-24
    - sed -e 's/FND-CLU/RUN-HOSTS/g' -i  ~/ardana-ci-tests/change-repo.yml

- name: deploy cluster ardana4.0_alpha-3
  logfile: testsuite-upgrade.log
  prefix: deploy-early-cluster
  playbooks:
    - FND-CLU-deploy.yml

- name: test keepalived version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-version.bash keepalived 1:1.2.13-1
    - validate-version.bash haproxy 1.5.8-1

- name: change apt-repo
  logfile: testsuite-upgrade.log
  prefix: change-apt-repo
  exec:
    - sed -e 's/RUN-HOSTS/FND-CLU/g' -i ~/ardana-ci-tests/restore-sources.list.yml
    - copy.bash restore-sources.list.yml
    - sed -e 's/FND-CLU/RUN-HOSTS/g' -i ~/ardana-ci-tests/restore-sources.list.yml

- name: test major pre upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-pre-upgrade.yml --limit *c0*

- name: Run base upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - _ardana-upgrade-base.yml --limit *c0*

- name: test  upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-upgrade.yml --limit *c0*

- name: test major post upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-post-upgrade.yml --limit *c0*

- name: test keepalived version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-orig-version.bash keepalived
    - validate-orig-version.bash haproxy

- name: test major pre upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-pre-upgrade.yml

- name: Run base upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - _ardana-upgrade-base.yml

- name: test  upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-upgrade.yml

- name: test major post upgrade
  logfile: testsuite-upgrade.log
  prefix: upgrade
  playbooks:
    - FND-CLU-post-upgrade.yml

- name: test keepalived version
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - validate-orig-version.bash keepalived
    - validate-orig-version.bash haproxy

- name: cleanup directories
  logfile: testsuite-upgrade.log
  prefix: upgrade
  exec:
    - sed -e 's/RUN-HOSTS/FND-CLU/g' -i ~/ardana-ci-tests/cleanup.yml
    - copy.bash cleanup.yml
    - sed -e 's/FND-CLU/RUN-HOSTS/g' -i ~/ardana-ci-tests/cleanup.yml


####Apache Test no conf####
#This is to test start and configure
#dont fail when there is no conf
#provided
- name: Test start-noconf
  logfile: testsuite-start.log
  prefix: start
  playbooks:
    - FND-AP2-start.yml

- name: test apache up
  logfile: testsuite-status.log
  prefix: status
  exec:
    - validate-apache2.bash

- name: Test enable site
  logfile: testsuite-enablesite.log
  prefix: enablesite
  exec:
     - create-apache-conf.bash

####Apache test reconfigure####
- name: Test Noop reconfigure
  logfile: testsuite-reconfigure-noop.log
  prefix: reconfigure-noop
  playbooks:
    - FND-AP2-reconfigure.yml

#TO-DO: This should test that apache hasnt restart
- name: Test apache up
  logfiel: testsuite-status.log
  prefix: status
  exec:
    - validate-apache2.bash
#TO-DO need a general update-conf
- name: Update conf file change
  logfile: testsuite-reconfigure-conf-change.log
  prefix: update-conf-all
  exec:
    - update-conf.bash apache2_loglevel info debug ./apache/defaults.yml

- name: Test reconfigure
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-AP2-reconfigure.yml

- name: Test Conf File change
  logfile: testsuite-reconfigure-conf-change.log
  prefix: test-apache-conf
  exec:
    - test-conf.bash 'LogLevel debug' /etc/apache2/apache2.conf

- name: reset conf file change
  logfile: testsuite-reconfigure-conf-change.log
  prefix: update-conf-all
  exec:
    - update-conf.bash apache2_loglevel debug info ./apache/defaults.yml

- name: Test reconfigure limit
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-AP2-reconfigure.yml --limit=*cp1*

#TO-DO: change this to use control plane as arg
#and check the value isnt changed on cp2
- name: Test Conf File change
  logfile: testsuite-reconfigure-conf-change.log
  prefix: test-apache-conf
  exec:
    - test-conf.bash 'LogLevel info' /etc/apache2/apache2.conf

- name: Test fix conf values
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-AP2-reconfigure.yml

####Apache test stop and start####
- name: Test apache-stop
  logfile: testsuite-stop.log
  prefix: stop
  playbooks:
    - FND-AP2-stop.yml

- name: Test apache down
  logfiel: testsuite-status.log
  prefix: status
  exec:
    - validate-apache2-down.bash

- name: Test apache-start
  logfile: testsuite-start.log
  prefix: start
  playbooks:
    - FND-AP2-start.yml

- name: Test apache up
  logfiel: testsuite-status.log
  prefix: status
  exec:
    - validate-apache2.bash

- name: Test apache-stop
  logfile: testsuite-stop.log
  prefix: stop
  playbooks:
    - FND-AP2-stop.yml --limit=project-cp1-c0-m1-mgmt

- name: Test apache down
  logfiel: testsuite-status.log
  prefix: status
  exec:
    - validate-apache2-down.bash

- name: Test apache-start
  logfile: testsuite-start.log
  prefix: start
  playbooks:
    - FND-AP2-start.yml --limit=project-cp1-c0-m1-mgmt

- name: Test apache up
  logfiel: testsuite-status.log
  prefix: status
  exec:
    - validate-apache2.bash

####Apache test reboot####
- name: Test reboot server2
  logfile: testsuite-reboot.log
  prefix: reboot-server2
  vms:
    - reboot: server2

- name: Test apache up
  logfile: testsuite-status.log
  prefix: status
  exec:
    - validate-apache2.bash


####Apache cleanup####
- name: Test disable site
  logfile: testsuite-disable.log
  prefix: cleanup
  exec:
    - disable-site.bash "test.conf"

- name: Test reconfigure
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-AP2-reconfigure.yml

###########keepalived + haproxy###########

####Test CLU stop and start####
- name: Test CLU stop
  logfile: testsuite-CLU-stop.log
  prefix: stop
  playbook:
    - FND-CLU-stop.yml

- name: Test CLU down
  logfile: testsuite-CLU-down.log
  prefix: check-status
  exec:
    - validate-CLU-down.bash

- name: Test CLU start
  logfile: testsuite-CLU-start.log
  prefix: start
  playbooks:
    - FND-CLU-start.yml

- name: Test CLU up
  logfile: testsuite-CLU-status.log
  prefix: status
  exec:
    - validate-CLU.bash

- name: Test CLU stop with limit
  logfile: testsuite-CLU-stop.log
  prefix: stop
  playbook:
    - FND-CLU-stop.yml --limit=project-cp1-c0-m1-mgmt

- name: Test CLU start with limit
  logfile: testsuite-CLU-start.log
  prefix: start
  playbooks:
    - FND-CLU-start.yml --limit=project-cp1-c0-m1-mgmt

- name: Test CLU up
  logfile: testsuite-CLU-status.log
  prefix: status
  exec:
    - validate-CLU.bash

####Test CLU reboot####
- name: Test reboot server2
  logfile: testsuite-reboot.log
  prefix: reboot-server2
  vms:
    - reboot: server2

- name: Test CLU start
  logfile: testsuite-CLU-start.log
  prefix: start
  playbooks:
    - FND-CLU-start.yml

- name: Test CLU up
  logfile: testsuite-CLU-status.log
  prefix: status
  exec:
    - validate-CLU.bash

####Test CLU reconfigure####

- name: Test reconfigure NOOP
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-CLU-reconfigure.yml

- name: Update password for single control plane
  logfile: testsuite-reconfigure-pwd-change.log
  prefix: update-pwd
  exec:
    - update-pwd.bash ~/ardana-ci-tests/pwd_change_cp1.yml
##note to self also update keepalived offset
- name: Test reconfigure NOOP
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-CLU-reconfigure.yml

- name: Test Conf File change
  logfile: testsuite-reconfigure-conf-change.log
  prefix: test-apache-conf
  exec:
    - test-conf.bash 'mynewpassword' /etc/haproxy/haproxy.cfg

- name: Test Conf File change
  logfile: testsuite-reconfigure-conf-change.log
  prefix: test-apache-conf
  exec:
    - test-conf.bash 'mynewpassword' /etc/keepalived/keepalived.conf

- name: Test vrrp_id change
  logfile: testsuite-reconfigure-keepalived.log
  prefix: test-vrrp-change
  exec:
    - update-conf.bash keepalived_vrrp_offset 0 55 ./keepalived/defaults.yml

- name: Test reconfigure limit
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-CLU-reconfigure.yml --limit=*cp1*

- name: Test Conf File change
  logfile: testsuite-reconfigure-conf-change.log
  prefix: test-apache-conf
  exec:
    - test-conf.bash 'virtual_router_id 56' /etc/keepalived/keepalived.conf

- name: Test vrrp_id change
  logfile: testsuite-reconfigure-keepalived.log
  prefix: test-vrrp-change
  exec:
    - update-conf.bash keepalived_vrrp_offset 55 0 ./keepalived/defaults.yml

- name: Test reconfigure limit
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - FND-CLU-reconfigure.yml

- name: Test CLU up
  logfile: testsuite-CLU-status.log
  prefix: status
  exec:
    - validate-CLU.bash

# TEST: replace node procedure
- name: CLU remove
  logfile: remove-nodes.log
  prefix: remove CLU
  playbooks:
    - FND-CLU-remove.yml --limit=project-cp2-c1-m2-mgmt -e automate=true

- name: apache-remove
  logfile: remove-nodes.log
  prefix: remove-apache
  playbooks:
    - FND-AP2-remove.yml --limit=project-cp2-c1-m2-mgmt -e automate=true

- name: remove-nodes
  logfile: remove.log
  prefix: remove-nodes
  exec:
    - remove-node-test.bash server3 SERVER3-ROLE cluster1

- name: run-cp
  logfile: remove.log
  prefix: run-cp
  exec:
    - run-cp.bash

- name: add-nodes
  logfile: add.log
  prefix: add-nodes
  exec:
    - add-node-test.bash server3 192.168.110.5 SERVER3-ROLE RACK2 8a:8e:64:55:43:76 192.168.109.5 cluster1

- name: run-cp
  logfile: remove.log
  prefix: run-cp
  exec:
    - run-cp.bash

- name: CLU-deploy
  logfile: deploy.log
  prefix: deploy-CLU
  playbooks:
    - FND-CLU-deploy.yml --limit=project-cp2-c1-m2-mgmt

- name: apache-deploy
  logfile: deploy.log
  prefix: deploy-apache
  playbooks:
    - FND-AP2-deploy.yml --limit=project-cp2-c1-m2-mgmt

- name: CLU-status
  logfile: status.log
  prefix: CLU-status
  playbooks:
    - FND-CLU-status.yml --limit=project-cp2-c1-m2-mgmt

- name: apache-status
  logfile: status.log
  prefix: apache-status
  playbooks:
    - FND-AP2-status.yml --limit=project-cp2-c1-m2-mgmt
07070100000038000081ED0000000000000000000000015E8327E60000041B000000000000000000000000000000000000004B00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/update-conf.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
set -vx
echo "Changing $2 to $3 for $1 in $4"
pushd ~/openstack/my_cloud/config
sed -e "s/$1: $2/$1: $3/g" -i "$4" --follow-symlinks
git add -A
git commit --allow-empty -m "My Config Change"
pushd ~/openstack/ardana/ansible/
ansible-playbook -i hosts/localhost config-processor-run.yml -e encrypt="" \
                     -e rekey=""
ansible-playbook -i hosts/localhost ready-deployment.yml
popd
popd
07070100000039000081ED0000000000000000000000015E8327E6000003FF000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/update-pwd.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
set -evx
cp $1 ~/ardana/change_credentials/
pushd ~/openstack/ardana/ansible/

# Next two lines should not be necessary but are, checking why
git add -A
git commit  --allow-empty -m "My Config Change"

ansible-playbook -i hosts/localhost config-processor-run.yml -e encrypt="" \
                     -e rekey=""
ansible-playbook -i hosts/localhost ready-deployment.yml
popd
0707010000003A000081ED0000000000000000000000015E8327E60000035F000000000000000000000000000000000000005100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/validate-CLU-down.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
ansible-playbook -i hosts/verb_hosts FND-CLU-status.yml
CLU_test_status=$?
echo "test status is $CLU_test_status"
if [ $CLU_test_status -eq 0 ]
then
  echo "Fail, Expected to be down!"
  exit 1
else
  echo "OK"
fi
0707010000003B000081ED0000000000000000000000015E8327E60000034E000000000000000000000000000000000000004C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/validate-CLU.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
ansible-playbook -i hosts/verb_hosts FND-CLU-status.yml
CLU_test_status=$?
echo "CLU Test Status is $CLU_test_status"
if [ $CLU_test_status -eq 0 ]
then
  echo "Ok"
else
  echo "Fail"
  exit 1
fi

0707010000003C000081ED0000000000000000000000015E8327E600000376000000000000000000000000000000000000005500000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/validate-apache2-down.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
ansible-playbook -i hosts/verb_hosts FND-AP2-status.yml
apache_test_status=$?
echo "apache test status is $apache_test_status"
if [ $apache_test_status -eq 0 ]
then
  echo "Fail, Expected apache to be down!"
  exit 1
else
  echo "OK"
fi
0707010000003D000081ED0000000000000000000000015E8327E600000359000000000000000000000000000000000000005000000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/validate-apache2.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
ansible-playbook -i hosts/verb_hosts FND-AP2-status.yml
apache_test_status=$?
echo "apache Test Status is $apache_test_status"
if [ $apache_test_status -eq 0 ]
then
  echo "Ok"
else
  echo "Fail"
  exit 1
fi
0707010000003E000081ED0000000000000000000000015E8327E60000037D000000000000000000000000000000000000005500000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/validate-orig-version.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
set -vx
version=`/usr/bin/apt-cache policy $1 |grep Installed |awk '{print $2}'`
orig_version=`grep $1 /tmp/cluversions | awk '{print $2}'`
if [[ $version == $orig_version ]]
then
  upgradestatus=0
else
  upgradestatus=1
fi
exit $upgradestatus
0707010000003F000081ED0000000000000000000000015E8327E600000338000000000000000000000000000000000000005000000000ardana-cluster-9.0+git.1585653734.c1fe3b2/ardana-ci/tests/validate-version.bash#!/bin/bash
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
set -vx
version=`/usr/bin/apt-cache policy $1 |grep Installed |awk '{print $2}'`

if [[ $version == $2 ]]
then
  upgradestatus=0
else
  upgradestatus=1
fi
exit $upgradestatus
07070100000040000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/config07070100000041000081A40000000000000000000000015E8327E600000370000000000000000000000000000000000000004500000000ardana-cluster-9.0+git.1585653734.c1fe3b2/config/apache-symlinks.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

# The following relative symlinks are created under the
# my_cloud/config directory.
---
symlinks:
  "apache/sites-enabled.conf.j2": "roles/FND-AP2/templates/sites-enabled.conf.j2"
  "apache/defaults.yml": "roles/FND-AP2/defaults/main.yml"
07070100000042000081A40000000000000000000000015E8327E600000361000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/config/haproxy-symlinks.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

# The following relative symlinks are created under the
# my_cloud/config directory.
---
symlinks:
  "haproxy/haproxy.cfg.j2": "roles/haproxy/templates/haproxy.cfg"
  "haproxy/defaults.yml": "roles/haproxy/defaults/main.yml"
07070100000043000081A40000000000000000000000015E8327E600000378000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/config/keepalived-symlinks.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

# The following relative symlinks are created under the
# my_cloud/config directory.
---
symlinks:
  "keepalived/keepalived.conf.j2": "roles/keepalived/templates/keepalived.conf.j2"
  "keepalived/defaults.yml": "roles/keepalived/defaults/main.yml"
07070100000044000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/library07070100000045000081A40000000000000000000000015E8327E60000099E000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/library/shell_changed_regexp.py#!/usr/bin/env python
#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

DOCUMENTATION = '''
---
module: shell_changed_regexp
short_description: runs shell command and sets changed attribute as per regexp
description:
   - Runs shell command and sets changed attribute if stdout matches to provided
   regexp. Unlike shell module with changed_when, works even if looped into
   with_items.
options:
   command:
     description:
        - command to run
     required: true
   changed_regexp:
     description:
        - regexp to match to set changed to True
   unchanged_regexp:
     description:
        - regexp to match to set changed to False

'''

EXAMPLES = '''
- shell_changed_regexp:
    command: "a2enmod {{ item }}"
    unchanged_regexp: " already "
  with_items:
    - wsgi
    - proxy
    - proxy_http
  become: yes
'''

import re

def _run_command(module):
    command = module.params['command']
    unchanged_regexp = module.params['unchanged_regexp']
    result, stdout, stderr = module.run_command(command)

    if result != 0:
        module.fail_json(msg="Command '%s' failed with exit code %d:\nstdout: %s\nstderr: %s" % (command, result, stdout, stderr))
    elif re.search(unchanged_regexp, stdout, re.S|re.M):
        module.exit_json(changed = False, result = "Unchanged")
    else:
        module.exit_json(changed = True, result = "Changed")

def main():
    module = AnsibleModule(
        argument_spec = dict(
            command  = dict(required=True),
            changed_regexp = dict(),
            unchanged_regexp = dict()
        ),
    )

    if not module.params.get('changed_regexp') and not module.params.get('unchanged_regexp'):
        module.fail_json(msg="Either changed_regexp or unchanged_regexp should be specified")

    _run_command(module)

from ansible.module_utils.basic import *
if __name__ == '__main__':
    main()
07070100000046000041ED0000000000000000000000075E8327E600000000000000000000000000000000000000000000003000000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles07070100000047000041ED0000000000000000000000075E8327E600000000000000000000000000000000000000000000003800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP207070100000048000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/defaults07070100000049000081A40000000000000000000000015E8327E60000042D000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/defaults/main.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# These should all be sourced from input model  vars
apache2_port: 80
apache2_restart_required: false
apache2_reload_required: false
apache2_service: apache2
apache2_listen_address: "{{ host | item('bind.FND_CLU.internal.ip_address', d='*') }}"
apache2_loglevel: info
apache2_timeout: 600

apache2_iptables_chain: apache2-temp
apache2_sitesenabled: False

max_request_workers: 150

apache_process_open_files_limit: 65536
0707010000004A000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/meta0707010000004B000081A40000000000000000000000015E8327E6000002A6000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/meta/main.yml# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---

dependencies:
  - role: iptables
0707010000004C000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks0707010000004D000081A40000000000000000000000015E8327E60000030D000000000000000000000000000000000000005400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/_schedule_restart.yml#
# (c) Copyright 2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: FND-AP2 | _schedule_restart | Schedule a restart for apache
  debug:
    msg: "Trigger a change notification for apache"
  changed_when: true
  register: ardana_notify_apache2_restart_required
0707010000004E000081A40000000000000000000000015E8327E60000054E000000000000000000000000000000000000005600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/check_sites_enabled.yml#
# (c) Copyright 2020 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: FND-AP2 | check_sites_enabled | Check if apache2ctl exists
  stat:
    path: /usr/sbin/apache2ctl
  register: _apache2ctl_stat_result

- name:  FND-AP2 | check_sites_enabled | Check if any sites enabled
  command: "apache2ctl -t -D DUMP_VHOSTS"
  become: yes
  register: _apache2_sites_result
  when: _apache2ctl_stat_result.stat.exists

- name:  FND-AP2 | check_sites_enabled | Indicate Sites configured
  debug:
    msg: "Apache has Sites configured"
  when: _apache2_sites_result is defined and
        (_apache2_sites_result.stdout_lines | length > 1)

- name: FND-AP2 | check_sites_enabled | Set sites enabled to True
  set_fact:
    apache2_sitesenabled: >-
      {{ _apache2_sites_result.stdout_lines | length > 1 }}
  when: not (_apache2_sites_result | skipped)
0707010000004F000081A40000000000000000000000015E8327E6000003B8000000000000000000000000000000000000005600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/check_upgraded_pkgs.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# check_upgraded_pkgs playbook
---
- name: FND-AP2 | check_upgraded_pkgs | Check upgraded packages
  debug:
    msg: "Notify change in apache package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: apache2_packages
  register: ardana_notify_apache2_restart_required
07070100000050000081A40000000000000000000000015E8327E600001040000000000000000000000000000000000000004C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Apache2 global conf
---
- name: FND-AP2 | configure | Disable default port listeners
  become: yes
  replace:
    dest: "{{ apache2_listen_conf }}"
    regexp: '^((?!#).)*(Listen[ ]+.*)' # noqa
    replace: '# \2'
  register: ardana_notify_apache2_restart_required

# This matches the keystone status play, that we use to check that
# keystone comes up.
- name: FND-AP2 | configure | Increase timeout
  become: yes
  lineinfile:
    line: "Timeout {{ apache2_timeout }}"
    regexp: "^Timeout [0-9]+"
    dest: "{{ apache2_global_conf }}"
    state: present
  register: ardana_notify_apache2_reload_required

- name: FND-AP2 | configure | Set loglevel
  become: yes
  lineinfile:
    line: 'APACHE_LOGLEVEL="{{ apache2_loglevel }}"'
    regexp: "^APACHE_LOGLEVEL=.*"
    dest: /etc/sysconfig/apache2
    state: present
  register: ardana_notify_apache2_reload_required
  when: ansible_os_family == 'Suse'

# Apache2 modules

- name: FND-AP2 | configure | Suse - switch to mpm_worker
  become: yes
  lineinfile:
    line: 'APACHE_MPM="worker"'
    regexp: "^APACHE_MPM=.*"
    dest: /etc/sysconfig/apache2
    state: present
  register: ardana_notify_apache2_restart_required
  when: ansible_os_family == 'Suse'

# Suse may have proxy_http module listed before proxy. This causes errors
# while loading modules
- name:  FND-AP2 | configure | Suse - check proxy module load order
  become: yes
  shell: |
    grep -E 'proxy_http .*proxy' /etc/sysconfig/apache2 \
    && a2dismod proxy_http \
    || true
  args:
    executable: /bin/bash
  when: ansible_os_family == 'Suse'

# apache_module does not set 'changed' attribute correctly under Suse, because
# a2enmod output format differs from Debian version
- name:  FND-AP2 | configure | Enable apache modules
  become: yes
  shell_changed_regexp:
    command: "a2enmod {{ item }}"
    unchanged_regexp: " already "
  with_items: apache2_modules
  register: ardana_notify_apache2_restart_required

- name: FND-AP2 | configure | Suse - set MaxClients
  become: yes
  replace:
    replace: "\tMaxClients          {{ max_request_workers }}"
    regexp: "^\\s*MaxClients\\s+[0-9]+$"
    dest: "/etc/apache2/server-tuning.conf"
  register: ardana_notify_apache2_reload_required
  when: ansible_os_family == 'Suse'

- name: FND-AP2 | configure | Suse - disable the default site
  become: yes
  lineinfile:
    line: '# Include /etc/apache2/default-server.conf'
    regexp: '^#?\s*Include\s+/etc/apache2/default-server\.conf'
    dest: /etc/apache2/httpd.conf
    state: present
  register: ardana_notify_apache2_reload_required
  when: ansible_os_family == 'Suse'

- name: FND-AP2 | configure | Suse - include conf files in conf.d
  become: yes
  lineinfile:
    line: 'IncludeOptional /etc/apache2/conf.d/*.conf'
    regexp: '^\s*IncludeOptional\s+/etc/apache2/conf\.d/\*\.conf'
    dest: /etc/apache2/httpd.conf
    state: present
  register: ardana_notify_apache2_reload_required
  when: ansible_os_family == 'Suse'

- name: FND-AP2 | configure | Suse - set default site permissions
  become: yes
  template:
    dest: /etc/apache2/conf.d/default.conf
    src: suse-default.conf.j2
    mode: 0644
  register: ardana_notify_apache2_reload_required
  when: ansible_os_family == 'Suse'

- name: FND-AP2 | configure | Add any sites to be enabled
  become: yes
  template:
    dest: "{{ apache2_vhost_dir }}/{{ item.key }}"
    src: sites-enabled.conf.j2
    mode: 0644
  with_dict: FND_AP2_sites_enabled | default({})
  register: ardana_notify_apache2_restart_required
07070100000051000081A40000000000000000000000015E8327E600000660000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/install.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: FND-AP2 | install | Install apache2
  become: yes
  package:
    name: "{{ item }}"
    state: present
  with_items: apache2_packages
  register: _install_apache_result

- name: FND-AP2 | install | Stop apache only after initialization
  include: stop.yml
  when: _install_apache_result.changed

- name: FND-AP2 | install | Enable apache2 service
  become: yes
  service:
    name: apache2
    enabled: yes

# on SLES, the default soft limit for open files for apache2 processes is
# 1024. This number is way too limit consider how many vhost it serves.
# i.e. keystone-admin wsgi itself can spawn off 5 process and each process
# can open up 50+ files. We definitely need to bump it up.
- name: FND-AP2 | install | Suse - Increase open files limit
  become: yes
  lineinfile:
    dest: /etc/systemd/system/apache.service
    line: "LimitNOFILE={{ apache_process_open_files_limit }}"
    insertafter: "^ExecStop=.*"
    state: present
  when: ansible_os_family == 'Suse'
07070100000052000081A40000000000000000000000015E8327E600000358000000000000000000000000000000000000004700000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/main.yml#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: FND-AP2 | main | Load OS dependent vars
  include_vars: "{{ item }}"
  with_first_found:
    - "{{ ansible_distribution | lower }}.yml"
    - "{{ ansible_os_family | lower }}.yml"
    - "default.yml"
07070100000053000081A40000000000000000000000015E8327E600000348000000000000000000000000000000000000004F00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/post-upgrade.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Remove the disable of restart of apache on upgrade
---
- name: FND-AP2 | post-upgrade | Re-enable the restart of apache
  become: yes
  service_restart:
    service: apache2
    state: enabled

07070100000054000081A40000000000000000000000015E8327E600000338000000000000000000000000000000000000004E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/pre-upgrade.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Disable restart of apache on upgrade
---
- name: FND-AP2 | pre-upgrade | Disable the re-start of apache
  become: yes
  service_restart:
    service: apache2
    state: disabled
07070100000055000081A40000000000000000000000015E8327E600000436000000000000000000000000000000000000004E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/remove_dirs.yml#
# (c) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# Remove these (file module does not do recursive remove)
#  /var/www/html/etc/apache2/sites-enabled
#  /etc/apache2/sites-available
#  /var/log/shibboleth
#  /etc/apache2
- name: FND-AP2 | remove_dirs | remove apache files and directories
  become: yes
  shell: >
    rm -rf /var/www/html/etc/apache2/sites-enabled
    rm -rf /var/log/shibboleth
    rm -rf /etc/apache2
    rm -f /usr/sbin/a2ensite
    rm -f /usr/sbin/a2dissite
07070100000056000081A40000000000000000000000015E8327E6000003C6000000000000000000000000000000000000005200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/remove_packages.yml#
# (c) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: FND-AP2 | remove_packages | Remove Apache packages
  become: yes
  package:
    name:  "{{ item }}"
    state: absent
  with_items: apache2_packages

# Directories left behind after this are
#  /var/www/html/etc/apache2/sites-enabled
#  /etc/apache2/sites-available
#  /var/log/shibboleth
#  /etc/apache2
07070100000057000081A40000000000000000000000015E8327E600000694000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/start.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: check_sites_enabled.yml

- name: FND-AP2 | start | Restart Apache
  become: yes
  service:
    name: apache2
    state: restarted
  when: ardana_notify_apache2_restart_required is defined and
        ardana_notify_apache2_restart_required.changed and
        apache2_sitesenabled | bool
  register: _apache2_restarted_result

- name: FND-AP2 | start | Reload Apache
  become: yes
  service:
    name: apache2
    state: reloaded
  when: ardana_notify_apache2_reload_required is defined and
        ardana_notify_apache2_reload_required.changed and
        apache2_sitesenabled | bool and
        not _apache2_restarted_result.changed

- name: FND-AP2 | start | Ensure that Apache is started
  become: yes
  service:
    name: apache2
    state: started
  when: apache2_sitesenabled | bool

- name: FND-AP2 | start | Wait until Apache started status OK
  become: yes
  shell: "systemctl status apache2"
  register: _status_result
  until: (_status_result | success)
  retries: 5
  delay: 5
  when: apache2_sitesenabled | bool
07070100000058000081A40000000000000000000000015E8327E600001505000000000000000000000000000000000000004F00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/start_reload.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# This playbook is for use by any apache-hosted service. It ensures that
# the apache service is started and will optionally reload apache if the
# apache_reload_requested variable is set to true (default is false)
# or restart apache if the apache_restart_requested variable is set to true
# (default is false).
# If apache was either started or reloaded and the keystone site is enabled,
# keystone status is invoked to ensure that keystone is up and running
# before returning from this playbook.

- name: FND-AP2 | start_reload | Ensure that Apache is started
  become: yes
  service:
    name: apache2
    state: started
  register: apache_started

- name: FND-AP2 | start_reload | pause after start
  pause:
    seconds: 3

- name: FND-AP2 | status | Check system service running
  command: systemctl status "{{ apache2_service }}"
  ignore_errors: yes
  register: apache_start_status
# BUG 3227 added retry on start to fix race in current apache version
- name: FND-AP2 | start_reload | start apache if previous failed
  become: yes
  service:
    name: apache2
    state: started
  when: apache_start_status is defined and apache_start_status | failed

- name: FND-AP2 | start_reload | Check Apache started status OK
  become: yes
  shell: "systemctl status apache2"
  when: apache_started.changed

# This is the list currently on this node and not from cp as we could be changing this list
- name: FND-AP2 | start_reload | Find out which ports apache traffic is running on
  become: yes
  shell: |
    apache2ctl -D DUMP_VHOSTS 2>/dev/null |
    awk '/{{ apache2_vhost_dir | regex_replace('/', '\/') }}/ \
    {IP = "127.0.0.1"; \
     if(NF > 2 && \
        $2 ~ /^[0-9]?[0-9]?[0-9]\.[0-9]?[0-9]?[0-9]\.[0-9]?[0-9]?[0-9]\.[0-9]?[0-9]?[0-9]$/) \
     {IP = $2}; \
     sub(/.*:/,"",$1); \
     printf "{\"ip\":\"%s\",\"port\":\"%s\"}\n",IP,$1}'
  register: apachectl_results
  when: ((apache_reload_requested | default(false) | bool) == True ) and (not apache_started.changed)

- name: FND-AP2 | start_reload | set apache fact to block traffic
  set_fact:
    apache2_ip_port: [ "{{ apachectl_results.stdout_lines | join(',') }}" ]
  when: apachectl_results.stdout_lines is defined

- include: "{{ playbook_dir }}/roles/iptables/tasks/iptables-add.yml"
  vars:
    iptables_chain: "{{ apache2_iptables_chain }}"
    iptables_ip_port: "{{ apache2_ip_port }}"
  when: ((apache_reload_requested | default(false) | bool) == True )  and (not apache_started.changed)

- name: FND-AP2 | start_reload | Reload apache if requested
  become: yes
  service:
    name: apache2
    state: reloaded
  when: ((apache_reload_requested | default(false) | bool) == True)  and (not apache_started.changed)
        and (apache_restart_requested | default(false) | bool == False)

- name: FND-AP2 | start_reload | Check Apache started status OK
  become: yes
  shell: "systemctl status apache2"
  when: ((apache_reload_requested | default(false) | bool) == True) and (not apache_started.changed)

- include: "{{ playbook_dir }}/roles/iptables/tasks/iptables-delete.yml"
  vars:
    iptables_chain: "{{ apache2_iptables_chain }}"
    iptables_ip_port: "{{ apache2_ip_port }}"
  when: ((apache_reload_requested | default(false) | bool) == True) and (not apache_started.changed)

- name: FND-AP2 | start_reload | Restart apache if requested
  become: yes
  service:
    name: apache2
    state: restarted
  when: ((apache_restart_requested | default(false) | bool) == True) and (not apache_started.changed)

# BUG 3227: Pause should allow apache restart to fail
# if the modwsgi processes havnt shutdown
- name: FND-AP2 | start_reload | pause after restart
  pause:
    seconds: 3
  when: ((apache_restart_requested | default(false) | bool) == True) and (not apache_started.changed)

- name: FND-AP2 | status | Check system service running
  command: systemctl status "{{ apache2_service }}"
  when: ((apache_restart_requested | default(false) | bool) == True) and (not apache_started.changed)
  ignore_errors: yes
  register: apache_restart_status

- name: FND-AP2 | start_reload | Restart apache if requested
  become: yes
  service:
    name: apache2
    state: restarted
  when: apache_restart_status is defined and apache_restart_status | failed

- include: status.yml

- name: FND-AP2 | start_reload | Check if keystone site enabled
  become: yes
  stat:
    path: "{{ apache2_vhost_dir }}/keystone-modwsgi.conf"
  register: keystone_site_file

- include: "{{ playbook_dir }}/roles/KEY-API/tasks/status.yml"
  when: keystone_site_file.stat.exists and (
        apache_started.changed or
        ((apache_reload_requested | default(false) | bool) == True) or
        ((apache_restart_requested | default(false) | bool) == True)
        )
07070100000059000081A40000000000000000000000015E8327E6000004CC000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/status.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: check_sites_enabled.yml

- name: FND-AP2 | status | Check system service running
  command: systemctl status "{{ apache2_service }}"
  changed_when: false
  register: _apache2_status_result
  when: apache2_sitesenabled | bool

- name: FND-AP2 | status | Report status of "{{ apache2_service }}"
  fail:
    msg: |
      {{ apache2_service }} is not running.
      systemctl status {{ apache2_service }}
      {{ _apache2_status_result.stdout }}
      {{ _apache2_status_result.stderr }}
  when: (_apache2_status_result | failed) and
        apache2_sitesenabled | bool
0707010000005A000081A40000000000000000000000015E8327E6000002EB000000000000000000000000000000000000004700000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/stop.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: FND-AP2 | stop | Stop Apache
  become: yes
  service:
    name: apache2
    state: stopped
0707010000005B000081A40000000000000000000000015E8327E600000568000000000000000000000000000000000000005400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/tasks/vhosts-transition.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: FND-AP2 | vhosts-transition | Set facts
  set_fact:
    legacy_vhost_dir: /etc/apache2/sites-enabled

- name: FND-AP2 | vhosts-transition | Remove old repo server
  become: yes
  file:
    path: "{{ legacy_vhost_dir }}/deployer_venv_server.conf"
    state: absent

- name: FND-AP2 | vhosts-transition | Move vhost files into place
  become: yes
  shell: |
    rename .conf .vhost {{ legacy_vhost_dir }}/*
    cp {{ legacy_vhost_dir }}/* {{ apache2_vhost_dir }}
    rm {{ legacy_vhost_dir }}/*
    cd {{ apache2_vhost_dir }}
    for i in *.vhost; do
      ln -rs $i $(echo $i | sed 's/.vhost/.conf/')
    done

- name: FND-AP2 | vhosts-transition | Restart Apache
  become: yes
  service:
    name: apache2
    state: restarted
0707010000005C000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/templates0707010000005D000081A40000000000000000000000015E8327E600000B4B000000000000000000000000000000000000005800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/templates/sites-enabled.conf.j2{#
#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
# {{ ansible_managed }}

Listen "{{ apache2_listen_address }}:{{ item.value.port }}"

<VirtualHost {{ item.value.listen }}:{{ item.value.port }}>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot {{ item.value.document_root }}

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

{% if ansible_os_family == 'Suse' %}
    ErrorLog /var/log/apache2/error_log
    CustomLog /var/log/apache2/access_log combined
{% else %}
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
{% endif %}

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

<Directory {{ item.value.document_root }}>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        Order allow,deny
        Allow from all
</Directory>

{% if item.value.additional_dirs is defined %}
{% for alias, dir in item.value.additional_dirs.items() %}
Alias "/{{ alias }}" "{{ dir }}"
<Directory {{ dir }}>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        Order allow,deny
        Allow from all
</Directory>
{% endfor %}
{% endif %}
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
0707010000005E000081A40000000000000000000000015E8327E600000511000000000000000000000000000000000000005700000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/templates/suse-default.conf.j2{#
#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
<Directory "{{ www_root }}">
        Options Indexes FollowSymLinks
        AllowOverride All
        <IfModule !mod_access_compat.c>
                Require all granted
        </IfModule>
        <IfModule mod_access_compat.c>
                Order allow,deny
                Allow from all
        </IfModule>
</Directory>

<Directory "/var/www">
        Options Indexes FollowSymLinks
        AllowOverride All
        <IfModule !mod_access_compat.c>
                Require all granted
        </IfModule>
        <IfModule mod_access_compat.c>
                Order allow,deny
                Allow from all
        </IfModule>
</Directory>
0707010000005F000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/vars07070100000060000081A40000000000000000000000015E8327E6000003B5000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/vars/default.yml#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
apache2_packages:
  - apache2
  - libapache2-mod-wsgi
  - libapache2-mod-shib2

apache2_modules:
  - wsgi
  - shib2
  - proxy
  - proxy_http

apache2_listen_conf: /etc/apache2/ports.conf
apache2_global_conf: /etc/apache2/apache2.conf
www_root: /var/www
apache2_vhost_dir: /etc/apache2/sites-available
07070100000061000081A40000000000000000000000015E8327E600000415000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-AP2/vars/sles.yml#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
apache2_packages:
  - apache2
  - apache2-worker
  - apache2-mod_wsgi
  - shibboleth-sp
  - apache2-mod_auth_openidc

apache2_modules:
  - access_compat
  - version
  - status
  - wsgi
  - shib2
  - proxy
  - proxy_http
  - auth_openidc

apache2_listen_conf: /etc/apache2/listen.conf
apache2_global_conf: /etc/apache2/server-tuning.conf
www_root: /srv/www
apache2_vhost_dir: /etc/apache2/vhosts.d
07070100000062000041ED0000000000000000000000045E8327E600000000000000000000000000000000000000000000003800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-CLU07070100000063000081A40000000000000000000000015E8327E600000554000000000000000000000000000000000000003F00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-CLU/README
(c) Copyright 2015 Hewlett Packard Enterprise Development LP
(c) Copyright 2017 SUSE LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.


Include:
  - haproxy - for load balancing
  - keepalived - for managing VIPs for haproxy

Pre-reqs:
  - haproxy user     - may be installed by haproxy package
  - haproxy group    - may be installed by haproxy package

Questions/Comments:
  - If chroot is used how to log to syslog and access stats socket
  - Is it necessary to be able to run more than one instance of haproxy
  - logging will need to be done to somewhere compatible with central logging
  - Each node participating in a single cluster should use a different priority
    in keepalived.conf
  - Should we be using an authentication block in keepalived.conf?

TODO: Fix race in haproxy startup. Need to sleep somewhere - it is being
restarted too soon. SJH - is this still relevant?

07070100000064000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-CLU/meta07070100000065000081A40000000000000000000000015E8327E6000002C1000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-CLU/meta/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

dependencies:
  - { role: haproxy }
  - { role: keepalived }
07070100000066000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-CLU/tasks07070100000067000081A40000000000000000000000015E8327E6000003E4000000000000000000000000000000000000005400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/FND-CLU/tasks/_schedule_restart.yml#
# (c) Copyright 2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: FND-CLU | _schedule_restart | Schedule a restart for haproxy
  debug:
    msg: "Trigger a change notification for haproxy"
  changed_when: true
  register: ardana_notify_haproxy_restart_required

- name: FND-CLU | _schedule_restart | Schedule a restart for keepalived
  debug:
    msg: "Trigger a change notification for keepalived"
  changed_when: true
  register: ardana_notify_keepalived_restart_required
07070100000068000041ED0000000000000000000000095E8327E600000000000000000000000000000000000000000000003800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy07070100000069000041ED0000000000000000000000055E8327E600000000000000000000000000000000000000000000004000000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy-monasca0707010000006A000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy-monasca/defaults0707010000006B000081A40000000000000000000000015E8327E600000474000000000000000000000000000000000000005200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy-monasca/defaults/main.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

haproxy_monasca_endpoints: |
    {%- for service in FND_CLU.has_proxy -%}
      {%- set proxy = FND_CLU.has_proxy[service] -%}
      {%- for network in proxy.networks -%}
        {%- for port in network.ports -%}
          {%- if network.terminate_tls is defined and network.terminate_tls -%}
            {#- We don't care if it's https or something else -#}
            https://{{ network.vip }}:{{ port }},
          {%- endif -%}
        {%- endfor -%}
      {%- endfor -%}
    {%- endfor -%}
0707010000006C000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004500000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy-monasca/meta0707010000006D000081A40000000000000000000000015E8327E6000002E6000000000000000000000000000000000000004E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy-monasca/meta/main.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
dependencies:
  - {role: haproxy}
  - {role: monasca-agent, run_mode: Use}
  - role: tls-vars
0707010000006E000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy-monasca/tasks0707010000006F000081A40000000000000000000000015E8327E600000465000000000000000000000000000000000000005400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy-monasca/tasks/configure.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: haproxy-monasca | configure | Monasca detection plugin CertificateCheck
  become: yes
  monasca_agent_plugin:
    name: CertificateCheck
    args:
      urls: "{{ (haproxy_monasca_endpoints | default(',', True)).rstrip(',') }}"
      dimensions: "service:haproxy"
      ca_certs: "{{ trusted_ca_bundle }}"
    overwrite_enable: True

- name: haproxy-monasca | configure | Run Monasca detection plugin for haproxy
  become: yes
  monasca_agent_plugin:
    name: haproxy
07070100000070000081A40000000000000000000000015E8327E600000A60000000000000000000000000000000000000003F00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/README
(c) Copyright 2015 Hewlett Packard Enterprise Development LP
(c) Copyright 2017 SUSE LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.


Include:
  - tls-frontend - to install server certs
  - haproxy - for load balancing

Pre-reqs:
  - haproxy user     - may be installed by haproxy package
  - haproxy group    - may be installed by haproxy package

Questions/Comments:
  - If chroot is used how to log to syslog and access stats socket
  - Is it necessary to be able to run more than one instance of haproxy
  - logging will need to be done to somewhere compatible with central logging

TODO: Fix race in haproxy startup. Need to sleep somewhere - it is being
restarted too soon.

TODO: mysql roundrobin or leastconn? ardana 1.0 has roundrobin, but I thought
leastconn suited replication best.

TODO: create certificate on each node having stunnel. The certificate should
be for the VIP associated with the IP-cluster and not a specific machine. This
means the certificate should be created on the ansible machine and copied to
all machines in the cluster. The credentials are currently hard-coded -
fix them.


v2 Input specific notes:

A service can specify vip-check as (a mysql example)

    vip-check: check port 9200 inter 12000 rise 3 fall 3

If not, a default string will be used.

    vip-check: check inter 12000 rise 3 fall 3

Service healthchecks:

The vars.healthcheck is deprecated. A service can specify healthcheck
in vip-options input.

Eg:
    endpoints:
    -   port: '80'
        has-vip: true
        vip-options:
        - "option httpchk GET /"
        - "stick on src"
        - "stick-table type ip size 200k expire 30m"
        roles:
        - public

If a service doesn't specify vip-options, a default healthcheck will
be added.

  "option httpchk GET /"

If a service doesn't want a healthcheck it needs to make this intent
explicit by having a vip-options in the input. It could be empty if
the service doesn't need any options at all.

  endpoints:
    -   port: '6080'
        has-vip: true
        vip-options:
        roles:
        - public

The haproxy globals and defaults are now also configurable from the
defaults in the haproxy role.

07070100000071000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/defaults07070100000072000081A40000000000000000000000015E8327E6000008D3000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/defaults/main.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

vip_check_defaults: "check inter 5000 rise 2 fall 5"

vip_options_defaults:
        - "option httpchk GET /"

haproxy_globals:
        - "chroot /var/lib/haproxy"
        - "user haproxy"
        - "group haproxy"
        - "daemon"
        - "log /dev/log local0 notice"
        - "maxconn 100000"
        - "spread-checks 50"
        - "stats socket /run/haproxy/admin.sock mode 660 level admin"
        - "stats timeout 30s"
        - "ssl-default-bind-options no-sslv3"
        - "ssl-default-server-options no-sslv3"
        - "ssl-default-bind-ciphers HIGH:!aNULL:!eNULL:!DES:!3DES:!SSLv3:!TLSv1:!CAMELLIA"
        - "ssl-default-server-ciphers HIGH:!aNULL:!eNULL:!DES:!3DES:!SSLv3:!TLSv1:!CAMELLIA"

# maximum number of workers allowed regardless of CPUs available
haproxy_max_processes: 3
# number of workers based on number of vCPUs (sockets*cores*hthreads)
haproxy_dyn_processes: "{{ ansible_processor_vcpus | default(1) | int }}"

haproxy_is_baremetal: "{{ True if ansible_virtualization_role == 'host' else False  }}"
haproxy_defaults:
        - "balance roundrobin"
        - "maxconn 1500"
        - "log global"
        - "mode tcp"
        - "option dontlognull"
        - "option tcpka"
        - "option tcplog"
        - "retries 3"
        - "timeout check 10s"
        - "timeout client 10m"
        - "timeout connect 10s"
        - "timeout http-request 10s"
        - "timeout queue 1m"
        - "timeout server 10m"

bind_defaults: ''
haproxy_service: haproxy
haproxy_restart_required: false
haproxy_restart_packages:
    - haproxy
haproxy_conf_dir: "/etc/haproxy/ardana-conf.d"
07070100000073000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/files07070100000074000081ED0000000000000000000000015E8327E60000018E000000000000000000000000000000000000005600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/files/enable_nonlocal_binding#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

if /sbin/sysctl -ne net.ipv4.ip_nonlocal_bind > /dev/null; then
    echo 1 > /proc/sys/net/ipv4/ip_nonlocal_bind
fi

if $( ! grep -s -E "^\s*net.ipv4.ip_nonlocal_bind\s*=\s*1" /etc/sysctl.conf > /dev/null ) ; then
    sed -i '/net.ipv4.ip_nonlocal_bind/d' /etc/sysctl.conf
    echo "net.ipv4.ip_nonlocal_bind = 1"  >> /etc/sysctl.conf
fi
07070100000075000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/handlers07070100000076000081A40000000000000000000000015E8327E600000323000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: Restart rsyslog
  service:
    name: rsyslog
    state: restarted
  become: yes

- name: haproxy_change
  set_fact:
    haproxy_restart_required: true
07070100000077000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/meta07070100000078000081A40000000000000000000000015E8327E6000002D5000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/meta/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
dependencies:
  - { role: tls-frontend }
  - {role: monasca-agent, run_mode: Use}
07070100000079000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks0707010000007A000081A40000000000000000000000015E8327E6000003C1000000000000000000000000000000000000005600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/check_upgraded_pkgs.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# check_upgraded_pkgs playbook
---
- name: haproxy | check_upgraded_pkgs | Check upgraded packages
  debug:
    msg: "Notify change in haproxy package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: haproxy_restart_packages
  register: ardana_notify_haproxy_restart_required
0707010000007B000081A40000000000000000000000015E8327E60000073D000000000000000000000000000000000000004C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: haproxy | configure | Ensure binding to non-up interfaces on ipv4
  become: yes
  sysctl:
    state: present
    name: 'net.ipv4.ip_nonlocal_bind'
    value: 1
    sysctl_set: yes
    reload: yes

- name: haproxy | configure | Ensure binding to non-up interfaces on ipv6
  become: yes
  sysctl:
    state: present
    name: 'net.ipv6.ip_nonlocal_bind'
    value: 1
    sysctl_set: yes
    reload: yes


- name: haproxy | configure | copy /etc/rsyslog.d/50-ardana-haproxy.conf
  template:
    src: 50-ardana-haproxy.conf.j2
    dest: /etc/rsyslog.d/50-ardana-haproxy.conf
    owner: root
    group: root
    mode: 0644
  become: yes
  notify:
    - Restart rsyslog

- name: haproxy | configure | Make sure conf directory exists
  become: yes
  file:
    path: "{{ haproxy_conf_dir }}"
    state: directory
    mode: 0755

- name: haproxy | configure | Add FND-CLU config
  become: yes
  template:
    src: haproxy.cfg
    dest: "{{ haproxy_conf_dir }}/10-FND-CLU.cfg"
    mode: 0644

- name: haproxy | configure | Merge to haproxy.cfg
  become: yes
  assemble:
    src: "{{ haproxy_conf_dir }}"
    dest: "/etc/haproxy/haproxy.cfg"
    mode: 0600
  register: ardana_notify_haproxy_restart_required
0707010000007C000081A40000000000000000000000015E8327E600000300000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/install.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: haproxy | install | Install haproxy packages
  become: yes
  package:
    name: haproxy
    state: present
0707010000007D000081A40000000000000000000000015E8327E6000002F3000000000000000000000000000000000000004700000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/main.yml#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: haproxy | main | Include platform specific values
  include_vars: "{{ ansible_os_family | lower }}.yml"
0707010000007E000081A40000000000000000000000015E8327E600000340000000000000000000000000000000000000004F00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/post-upgrade.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#
# Remove the disable of restart on upgrade
---
- name: haproxy | post-upgrade | Re-enable the restart of haproxy
  become: yes
  service_restart:
    service: haproxy
    state: enabled
0707010000007F000081A40000000000000000000000015E8327E600000334000000000000000000000000000000000000004E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/pre-upgrade.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#
# Disable restart of on upgrade
---
- name: haproxy | pre-upgrade | Disable the re-start of haproxy
  become: yes
  service_restart:
    service: haproxy
    state: disabled
07070100000080000081A40000000000000000000000015E8327E60000036A000000000000000000000000000000000000004E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/remove_dirs.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# Remove these (file module does not do recursive remove)
#  /var/lib/haproxy/dev
#  /etc/haproxy
- name: haproxy | remove_dirs | remove haproxy dirs
  become: yes
  shell: >
    rm -rf /var/lib/haproxy/dev
    rm -rf /etc/haproxy
07070100000081000081A40000000000000000000000015E8327E600000411000000000000000000000000000000000000005200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/remove_packages.yml#
# (c) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# Directories/files left behind after this are
#  /var/lib/haproxy/dev
#  /etc/haproxy

- name: haproxy | remove_packages | Suse - Remove haproxy packages
  become: yes
  command: zypper remove --no-confirm --clean-deps haproxy
  register: _haproxy_remove_result
  failed_when: _haproxy_remove_result.rc != 0 and
      _haproxy_remove_result.rc != 104
  when: ansible_os_family == 'Suse'
07070100000082000081A40000000000000000000000015E8327E6000004BE000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/start.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: haproxy | start | Make sure /run/haproxy directory exists
  become: yes
  file:
    path: /run/haproxy
    state: directory
    mode: 0755

- name: haproxy | start | Restart haproxy
  become: yes
  service:
    name: haproxy
    state: restarted
  register: _haproxy_restarted_result
  when: ardana_notify_haproxy_restart_required is defined and
        ardana_notify_haproxy_restart_required.changed and
        _haproxy_restarted_result is not defined

- name:  haproxy | start | Start haproxy
  become: yes
  service:
    name: haproxy
    state: started
07070100000083000081A40000000000000000000000015E8327E6000004EE000000000000000000000000000000000000004900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/status.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: haproxy | status | Print service being checked
  debug:
    msg: "Running service check for {{ haproxy_service }}"
  run_once: true

- name: haproxy | status | Check system service running
  command: systemctl status "{{ haproxy_service }}"
  failed_when: false
  changed_when: false
  register: _haproxy_status_result

- name: haproxy | status | Report status of haproxy
  fail:
    msg: |
      {{ haproxy_service }} is not running.
      systemctl status {{ haproxy_service }}
      {{ _haproxy_status_result.stdout }}
      {{ _haproxy_status_result.stderr }}
  when: (_haproxy_status_result | failed)
07070100000084000081A40000000000000000000000015E8327E6000002EC000000000000000000000000000000000000004700000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/tasks/stop.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: haproxy | stop | Stop haproxy
  become: yes
  service:
    name: haproxy
    state: stopped
07070100000085000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/templates07070100000086000081A40000000000000000000000015E8327E600000349000000000000000000000000000000000000005C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/templates/50-ardana-haproxy.conf.j2{#
#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017,2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
# Send HAProxy messages to a dedicated logfile
$InputUnixListenSocketCreatePath on
$AddUnixListenSocket /var/lib/haproxy/dev/log
:programname, contains, "haproxy" /var/log/haproxy.log
& stop
07070100000087000081A40000000000000000000000015E8327E600000F17000000000000000000000000000000000000004E00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/templates/haproxy.cfg{#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
# For custom site-specific configuration, please see the end of this file.

global
{%- for hglobal in haproxy_globals %}

    {{ hglobal }}
{%- endfor %}
{% set haproxy_processes = ([ haproxy_dyn_processes|int, haproxy_max_processes ]|sort)[0] %}
{%- if haproxy_processes > 1 %}

    nbproc {{ haproxy_processes }}
{%- for i in range(haproxy_processes) %}

    cpu-map {{ loop.index }} {{ loop.index }}
{%- endfor %}
{%- endif %}


defaults
{%- for hdefault in haproxy_defaults|list + haproxy_defaults_os|list %}

    {{ hdefault }}
{%- endfor %}


listen stats
    bind {{ host.bind.FND_CLU.internal.ip_address }}:{{ host.bind.FND_CLU.internal.port }}
    mode http
    stats enable
    stats uri /
    stats realm HAProxy\ Statistics
    stats auth {{ FND_CLU.vars.haproxy_stats_user }}:{{ FND_CLU.vars.haproxy_stats_password }}
    bind-process 1

{%- for service in FND_CLU.has_proxy | default({}) %}
  {% set proxy = FND_CLU.has_proxy[service] %}
  {% set process = loop.index0 % haproxy_processes + 1 %}
  {%- for network in proxy.networks %}
    {%- for port in network.ports %}
      {% set server_port = network.server_ports[loop.index0] | default(port) %}

{%- if network.terminate_tls is defined and network.terminate_tls and port == '80' %}
    {% set port = '443' %}
{%- endif %}


listen {{ network.vip }}-{{ port }}
    {%- set options = network.vip_options | default(vip_options_defaults) %}
      {%- if options > 0 %}
        {%- for option in options %}

    {{ option }}
        {%- endfor %}
      {%- endif %}

    bind-process {{ process }}

    bind {{ network.vip }}:{{ port }} {% if network.terminate_tls is defined and network.terminate_tls %} ssl crt {{ frontend_server_cert_directory }}/{{ network.cert_file }} {{ bind_defaults }} {% endif %}
        {%- for server in proxy.servers %}
            {%- set backend_check = network.vip_check | default(vip_check_defaults) %}
            {%- if network.vip_backup_mode is defined and network.vip_backup_mode and loop.index != 1 %}
                    {% set backup = "backup" %}
            {%- else %}
                    {% set backup = "" %}
            {%- endif %}
            {%- if proxy.initiate_tls | default(False) %}
                    {% set ssl_check = "ssl verify none" %}
            {%- else %}
                    {% set ssl_check = "" %}
            {%- endif %}

    server {{ server }}-{{ service }}-{{ server_port }} {{ server }}:{{ server_port }} {{ backend_check }} {{ backup }} {{ ssl_check }}
        {%- endfor %}
    {%- endfor %}
  {%- endfor %}
{%- endfor %}

#
# BEGIN CUSTOM CONFIGURATION
#
# Place any custom VIP definitions here: for manual HDP service definitions only

# VIP service names and server identifiers are for reporting only.
# listen YOUR-VIP-SERVICE-NAME-GOES-HERE
#     option httpchk GET /
#     # The external IP address and port
#     bind 1.2.3.4:6789
#     server SERVER-AND-SERVICE-IDENTIFIER-1-HERE 192.168.99.1:6789 check inter 2000 rise 2 fall 5
#     server SERVER-AND-SERVICE-IDENTIFIER-2-HERE 192.168.99.2:6789 check inter 2000 rise 2 fall 5
#     server SERVER-AND-SERVICE-IDENTIFIER-3-HERE 192.168.99.3:6789 check inter 2000 rise 2 fall 5

#
# END CUSTOM CONFIGURATION
#
07070100000088000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000003D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/vars07070100000089000081A40000000000000000000000015E8327E6000003EC000000000000000000000000000000000000004800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/vars/debian.yml#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

haproxy_defaults_os:
  - "errorfile 400 /etc/haproxy/errors/400.http"
  - "errorfile 403 /etc/haproxy/errors/403.http"
  - "errorfile 408 /etc/haproxy/errors/408.http"
  - "errorfile 500 /etc/haproxy/errors/500.http"
  - "errorfile 502 /etc/haproxy/errors/502.http"
  - "errorfile 503 /etc/haproxy/errors/503.http"
  - "errorfile 504 /etc/haproxy/errors/504.http"
0707010000008A000081A40000000000000000000000015E8327E6000004CC000000000000000000000000000000000000004600000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/haproxy/vars/suse.yml#
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

haproxy_defaults_os:
  - "errorfile 400 /usr/share/doc/packages/haproxy/examples/errorfiles/400.http"
  - "errorfile 403 /usr/share/doc/packages/haproxy/examples/errorfiles/403.http"
  - "errorfile 408 /usr/share/doc/packages/haproxy/examples/errorfiles/408.http"
  - "errorfile 500 /usr/share/doc/packages/haproxy/examples/errorfiles/500.http"
  - "errorfile 502 /usr/share/doc/packages/haproxy/examples/errorfiles/502.http"
  - "errorfile 503 /usr/share/doc/packages/haproxy/examples/errorfiles/503.http"
  - "errorfile 504 /usr/share/doc/packages/haproxy/examples/errorfiles/504.http"
0707010000008B000041ED0000000000000000000000065E8327E600000000000000000000000000000000000000000000003B00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived0707010000008C000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/defaults0707010000008D000081A40000000000000000000000015E8327E600000419000000000000000000000000000000000000004D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/defaults/main.yml#
# (c) Copyright 2015, 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

keepalived_vrrp_offset: 0
keepalived_restart_required: false
keepalived_service: keepalived
keepalived_restart_packages:
   - keepalived
keepalived_vrrp_index: "{{ FND_CLU.vars.keepalived_vrrp_index }}"
keepalive_vrrp_password: "{{ FND_CLU.vars.keepalive_vrrp_password | default('') }}"
keepalived_cluster_name: "{{
    host.my_dimensions.cloud_name ~ '_' ~
    host.my_dimensions.control_plane }}"
0707010000008E000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/handlers0707010000008F000081A40000000000000000000000015E8327E600000329000000000000000000000000000000000000004D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: Restart rsyslog
  service:
    name: rsyslog
    state: restarted
  become: yes

- name: keepalived_change
  set_fact:
    keepalived_restart_required: true
07070100000090000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks07070100000091000081A40000000000000000000000015E8327E6000003C9000000000000000000000000000000000000005900000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/check_upgraded_pkgs.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# check_upgraded_pkgs playbook
---
- name: keepalived | check_upgraded_pkgs | Check upgraded packages
  shell: echo "Notify change in keepalived package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: keepalived_restart_packages
  register: ardana_notify_keepalived_restart_required
07070100000092000081A40000000000000000000000015E8327E6000009E2000000000000000000000000000000000000004F00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: keepalived | configure | workout vrrp_router_id
  set_fact:
    router_id: >
      {{ (keepalived_vrrp_index | int) * 20 +
          (keepalived_vrrp_offset | int) +
          (network_interfaces | default({}) | length| int) }}

- name: keepalived | configure | check bounds of vrrp_router_id
  fail:
    msg: "The vrrp_router_id {{ router_id }} exceeds max limit for keepalived"
  when: router_id|int > 255

- name: keepalived | configure | Configure keepalived daemon
  become: yes
  template:
    src: keepalived.conf.j2
    dest: /etc/keepalived/keepalived.conf
    owner: root
    group: root
    mode: 0644
  register: ardana_notify_keepalived_restart_required

- name: keepalived | configure | Install keepalived_vip_change.sh script
  become: yes
  template:
    src: keepalived_vip_change.sh.j2
    dest: /usr/local/bin/keepalived_vip_change.sh
    owner: root
    group: root
    mode: 0744

- name: keepalived | configure | Install virtual_ips list
  become: yes
  template:
    src: virtual_ips.j2
    dest: /etc/keepalived/virtual_ips
    owner: root
    group: root
    mode: 0640

- name: keepalived | configure | Configure rsyslog settings
  become: yes
  template:
    src: 50-ardana-keepalived.conf.j2
    dest: /etc/rsyslog.d/50-ardana-keepalived.conf
    owner: root
    group: root
    mode: 0644
  notify:
    - Restart rsyslog

- name: keepalived | configure | Configure logrotate settings
  become: yes
  template:
    src: keepalived.logrotate.j2
    dest: /etc/logrotate.d/keepalived
    owner: root
    group: root
    mode: 0644

- name: keepalived | configure | Suse - configure service defaults
  become: yes
  lineinfile:
    line: 'KEEPALIVED_OPTIONS=""'
    regexp: "^KEEPALIVED_OPTIONS=.*"
    dest: /etc/sysconfig/keepalived
    state: present
  register: ardana_notify_keepalived_restart_required
  when: ansible_os_family == 'Suse'
07070100000093000081A40000000000000000000000015E8327E600000337000000000000000000000000000000000000004D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/install.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: keepalived | install | Install keepalived package
  become: yes
  package:
    name:  "{{ item }}"
    state: present
  with_items:
    - keepalived
    - psmisc
07070100000094000081A40000000000000000000000015E8327E60000034A000000000000000000000000000000000000005200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/post-upgrade.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Remove the disable of restart of on upgrade
---
- name: keepalived | post-upgrade | Re-enable the restart of keepalived
  become: yes
  service_restart:
    service: keepalived
    state: enabled
07070100000095000081A40000000000000000000000015E8327E600000338000000000000000000000000000000000000005100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/pre-upgrade.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Disable restart on upgrade
---
- name: keepalived | pre-upgrade | Disable the re-start of keepalived
  become: yes
  service_restart:
    service: keepalived
    state: disabled
07070100000096000081A40000000000000000000000015E8327E600000338000000000000000000000000000000000000005100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/remove_dirs.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# Remove these (file module does not do recursive remove)
#  /etc/keepalived
- name: keepalived | remove_dirs | remove keepalived dirs
  become: yes
  shell: rm -rf /etc/keepalived
07070100000097000081A40000000000000000000000015E8327E60000040E000000000000000000000000000000000000005500000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/remove_packages.yml#
# (c) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
# Directories/files left behind after this are
#  /etc/keepalived

- name: keepalived | remove_packages | Suse - Remove keepalived packages
  become: yes
  command: zypper remove --no-confirm --clean-deps keepalived
  register: _keepalived_remove_result
  failed_when: _keepalived_remove_result.rc != 0 and
      _keepalived_remove_result.rc != 104
  when: ansible_os_family == 'Suse'
07070100000098000081A40000000000000000000000015E8327E600000447000000000000000000000000000000000000004B00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/start.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: keepalived | start | Restart keepalived
  become: yes
  service:
    name: keepalived
    state: restarted
  register: _keepalived_restarted_result
  when: ardana_notify_keepalived_restart_required is defined
        and ardana_notify_keepalived_restart_required.changed
        and _keepalived_restarted_result is not defined

- name: keepalived | start | Start keepalived
  become: yes
  service:
    name: keepalived
    state: started
07070100000099000081A40000000000000000000000015E8327E600000514000000000000000000000000000000000000004C00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/status.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: keepalived | status | Print service being checked
  debug:
    msg: "Running service check for {{ keepalived_service }}"
  run_once: true

- name: keepalived | status | Check system service running
  command: systemctl status "{{ keepalived_service }}"
  failed_when: false
  changed_when: false
  register: _keepalived_status_result

- name: keepalived | status | Report status of keepalived
  fail:
    msg: |
      {{ keepalived_service }} is not running.
      systemctl status {{ keepalived_service }}
      {{ _keepalived_status_result.stdout }}
      {{ _keepalived_status_result.stderr }}
  when: (_keepalived_status_result | failed)


0707010000009A000081A40000000000000000000000015E8327E6000002F5000000000000000000000000000000000000004A00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/tasks/stop.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: keepalived | stop | Stop keepalived
  become: yes
  service:
    name: keepalived
    state: stopped
0707010000009B000041ED0000000000000000000000025E8327E600000000000000000000000000000000000000000000004500000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/templates0707010000009C000081A40000000000000000000000015E8327E600000301000000000000000000000000000000000000006200000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/templates/50-ardana-keepalived.conf.j2{#
#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017,2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
# Send keepalive messages to a dedicated logfile
:programname, regex, "[kK]eepalived.*" /var/log/keepalived.log
& stop
0707010000009D000081A40000000000000000000000015E8327E600000783000000000000000000000000000000000000005800000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/templates/keepalived.conf.j2{#
#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
# Configuration file for keepalived
# This configuration is described in http://www.keepalived.org/pdf/UserGuide.pdf

global_defs {
    script_user root
    enable_script_security
}

vrrp_script chk_haproxy {
  script "/usr/bin/systemctl -q is-active haproxy.service"
  interval 3
  rise 2
  fall 2
}

vrrp_sync_group VG_{{ keepalived_cluster_name }} {
  group {
{% for intf in network_interfaces | default({}) %}
    VI_{{ loop.index }}
{% endfor %}
  }
}

{% for intf in network_interfaces | default({}) %}
{% if intf.has_key('vip_address') %}
vrrp_instance VI_{{ loop.index }} {
  state BACKUP
  {% set max_vips_per_tier = 20 -%}
  virtual_router_id {{ keepalived_vrrp_index|int * max_vips_per_tier|int + keepalived_vrrp_offset|int + loop.index}}
  priority 200
  nopreempt
  garp_master_refresh 2
  interface {{ intf.device }}{% if intf.has_key('vlan') %}.{{ intf.vlan }}{% endif %}

  {% if keepalive_vrrp_password -%}
  authentication {
    auth_type AH
    auth_pass {{ keepalive_vrrp_password }}
  }
  {% endif %}

  virtual_ipaddress {
    {{ intf.vip_address }}{% if intf.has_key('vlan') %} dev {{ intf.device }}.{{ intf.vlan }}{% endif %}

  }
  track_script {
    chk_haproxy
  }
  notify /usr/local/bin/keepalived_vip_change.sh
}
{% endif %}
{% endfor %}
0707010000009E000081A40000000000000000000000015E8327E6000002F1000000000000000000000000000000000000005B00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/templates/keepalived.default.j2{#
#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
# Options to pass to keepalived

# DAEMON_ARGS are appended to the keepalived command-line
DAEMON_ARGS="-D"
0707010000009F000081A40000000000000000000000015E8327E60000034D000000000000000000000000000000000000005D00000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/templates/keepalived.logrotate.j2{#
#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
/var/log/keepalived.log {
    daily
    rotate 52
    missingok
    notifempty
    compress
    delaycompress
    postrotate
        invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
    endscript
}
070701000000A0000081A40000000000000000000000015E8327E6000004A8000000000000000000000000000000000000006100000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/templates/keepalived_vip_change.sh.j2#!/bin/bash
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
# A simple script triggered by keepalived when VIPs are moved
# around. When VIPs are moved to this node, explicit route for
# each VIP is added - this assures that any connection to VIP
# will use by default local-ipv4 as source address. Without this
# explicit route VIP address is used which causes issues when VIP
# moved to another node.
#
# When VIP is moved from this node, this explicit route is removed
# to allow proper routing from this node to new VIP node.

set -eu

logger "Started $0 $@"
PATH="$PATH:/bin:/sbin"

TYPE=$1
NAME=$2
STATE=$3

if [ "$STATE" = "MASTER" ]; then
    while read -r VIP_NAME VIP_IP SERVER_IP; do
        if [ "$VIP_NAME" = "$NAME" ]; then
            logger "adding explicit route for $VIP_IP"
            ip ro replace local $VIP_IP dev lo src $SERVER_IP
        fi
    done < /etc/keepalived/virtual_ips
else
    while read -r VIP_NAME VIP_IP SERVER_IP; do
        if [ "$VIP_NAME" = "$NAME" ]; then
            logger "removing explicit route for $VIP_IP"
            ip ro del local $VIP_IP
        fi
    done < /etc/keepalived/virtual_ips
fi
070701000000A1000081A40000000000000000000000015E8327E60000033B000000000000000000000000000000000000005400000000ardana-cluster-9.0+git.1585653734.c1fe3b2/roles/keepalived/templates/virtual_ips.j2{#
#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#}
{% for intf in network_interfaces | default({}) %}
{% if intf.has_key('vip_address') %}
VI_{{ loop.index }} {{ intf.vip_address }} {{ intf.server_address }}
{% endif %}
{% endfor %}
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!394 blocks
openSUSE Build Service is sponsored by