File ardana-designate-8.0+git.1573597788.15b7984.obscpio of Package ardana-designate

07070100000000000081A40000000000000000000000015DCB325C00000068000000000000000000000000000000000000003D00000000ardana-designate-8.0+git.1573597788.15b7984/.copyrightignoreroles/designate-common/files/policy.json
roles/powerdns-post-configure/files/backend-pdns4-mysql-db.sql
07070100000001000081A40000000000000000000000015DCB325C00000081000000000000000000000000000000000000003700000000ardana-designate-8.0+git.1573597788.15b7984/.gitreview[gerrit]
host=gerrit.prv.suse.net
port=29418
project=ardana/designate-ansible.git
defaultremote=ardana
defaultbranch=stable/pike
07070100000002000081A40000000000000000000000015DCB325C0000000C000000000000000000000000000000000000003A00000000ardana-designate-8.0+git.1573597788.15b7984/.rsync-filter- ardana-ci
07070100000003000081A40000000000000000000000015DCB325C0000279F000000000000000000000000000000000000003400000000ardana-designate-8.0+git.1573597788.15b7984/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.

07070100000004000081A40000000000000000000000015DCB325C0000042E000000000000000000000000000000000000003600000000ardana-designate-8.0+git.1573597788.15b7984/README.md#
# (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.
#

README
======

This repo contains the following roles:
- designate-api: designate-api role
- designate-central: designate-central role
- designate-mdns: designate-mdns role
- designate-worker: designate-worker role
- designate-producer: designate-producer role
- designate-pool-manager: designate-pool-manager role (Deprecated)
- designate-zone-manager: designate-zone-manager role (Deprecated)

- powerdns: PowerDNS
- bind: BIND
07070100000005000081A40000000000000000000000015DCB325C000002EE000000000000000000000000000000000000004E00000000ardana-designate-8.0+git.1573597788.15b7984/_bind-check-upgraded-packages.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-BND
  roles:
    - bind
  tasks:
    - include: roles/bind/tasks/check_upgraded_packages.yml
07070100000006000081A40000000000000000000000015DCB325C000002E5000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/_bind-configure.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-BND
  roles:
    - bind
  tasks:
    - include: roles/bind/tasks/configure.yml
07070100000007000081A40000000000000000000000015DCB325C000002E3000000000000000000000000000000000000003E00000000ardana-designate-8.0+git.1573597788.15b7984/_bind-install.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-BND
  roles:
    - bind
  tasks:
    - include: roles/bind/tasks/install.yml
07070100000008000081A40000000000000000000000015DCB325C000002D7000000000000000000000000000000000000004700000000ardana-designate-8.0+git.1573597788.15b7984/_bind-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 bind services using ardana_notify_... variables
- hosts: all
  tasks:
    - include: roles/bind/tasks/_schedule_restart.yml07070100000009000081A40000000000000000000000015DCB325C0000063D000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/_designate-check-upgraded-packages.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.
#
---

- hosts: DES-API
  roles:
    - designate-api
  tasks:
    - include: roles/designate-api/tasks/check_upgraded_packages.yml

- hosts: DES-CEN
  roles:
    - designate-central
  tasks:
    - include: roles/designate-central/tasks/check_upgraded_packages.yml

- hosts: DES-PMG
  roles:
    - designate-pool-manager
  tasks:
    - include: roles/designate-pool-manager/tasks/check_upgraded_packages.yml

- hosts: DES-WKR
  roles:
    - designate-worker
  tasks:
    - include: roles/designate-worker/tasks/check_upgraded_packages.yml

- hosts: DES-ZMG
  roles:
    - designate-zone-manager
  tasks:
    - include: roles/designate-zone-manager/tasks/check_upgraded_packages.yml

- hosts: DES-PDR
  roles:
    - designate-producer
  tasks:
    - include: roles/designate-producer/tasks/check_upgraded_packages.yml

- hosts: DES-MDN:DES-MDN-EXT
  roles:
    - designate-mdns
  tasks:
    - include: roles/designate-mdns/tasks/check_upgraded_packages.yml
0707010000000A000081A40000000000000000000000015DCB325C000005DB000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/_designate-configure.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.
#
---

- hosts: DES-API
  roles:
    - designate-api
  tasks:
    - include: roles/designate-api/tasks/configure.yml

- hosts: DES-CEN
  roles:
    - designate-central
  tasks:
    - include: roles/designate-central/tasks/configure.yml

- hosts: DES-PMG
  roles:
    - designate-pool-manager
  tasks:
    - include: roles/designate-pool-manager/tasks/configure.yml

- hosts: DES-ZMG
  roles:
    - designate-zone-manager
  tasks:
    - include: roles/designate-zone-manager/tasks/configure.yml

- hosts: DES-WKR
  roles:
    - designate-worker
  tasks:
    - include: roles/designate-worker/tasks/configure.yml

- hosts: DES-PDR
  roles:
    - designate-producer
  tasks:
    - include: roles/designate-producer/tasks/configure.yml

- hosts: DES-MDN:DES-MDN-EXT
  roles:
    - designate-mdns
  tasks:
    - include: roles/designate-mdns/tasks/configure.yml
0707010000000B000081A40000000000000000000000015DCB325C000005CD000000000000000000000000000000000000004300000000ardana-designate-8.0+git.1573597788.15b7984/_designate-install.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.
#
---

- hosts: DES-API
  roles:
    - designate-api
  tasks:
    - include: roles/designate-api/tasks/install.yml

- hosts: DES-CEN
  roles:
    - designate-central
  tasks:
    - include: roles/designate-central/tasks/install.yml

- hosts: DES-PMG
  roles:
    - designate-pool-manager
  tasks:
    - include: roles/designate-pool-manager/tasks/install.yml

- hosts: DES-ZMG
  roles:
    - designate-zone-manager
  tasks:
    - include: roles/designate-zone-manager/tasks/install.yml

- hosts: DES-WKR
  roles:
    - designate-worker
  tasks:
    - include: roles/designate-worker/tasks/install.yml

- hosts: DES-PDR
  roles:
    - designate-producer
  tasks:
    - include: roles/designate-producer/tasks/install.yml

- hosts: DES-MDN:DES-MDN-EXT
  roles:
    - designate-mdns
  tasks:
    - include: roles/designate-mdns/tasks/install.yml
0707010000000C000081A40000000000000000000000015DCB325C00000491000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/_designate-post-configure.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.
#
---

# Configure Designate database
- hosts: DES-CEN
  roles:
    - designate-post-configure
  # All these tasks should be set to run-once
  tasks:
    - include: roles/designate-post-configure/tasks/db_configure.yml

# Configure Designate keystone resources
- hosts: DES-API
  roles:
    - designate-post-configure
  # This task should be set to run-once
  tasks:
    - include: roles/designate-post-configure/tasks/keystone_conf.yml
      ansible_python_interpreter: "{{ KEY_CLI.vars.keystone_client_python_interpreter }}"
0707010000000D000081A40000000000000000000000015DCB325C000002EC000000000000000000000000000000000000004C00000000ardana-designate-8.0+git.1573597788.15b7984/_designate-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 designate services using ardana_notify_... variables
- hosts: all
  tasks:
    - include: roles/designate-common/tasks/_schedule_restart.yml0707010000000E000081A40000000000000000000000015DCB325C000002F6000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/_powerdns-check-upgraded-packages.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-PDN
  roles:
    - powerdns
  tasks:
    - include: roles/powerdns/tasks/check_upgraded_packages.yml
0707010000000F000081A40000000000000000000000015DCB325C000002ED000000000000000000000000000000000000004400000000ardana-designate-8.0+git.1573597788.15b7984/_powerdns-configure.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-PDN
  roles:
    - powerdns
  tasks:
    - include: roles/powerdns/tasks/configure.yml
07070100000010000081A40000000000000000000000015DCB325C000002EB000000000000000000000000000000000000004200000000ardana-designate-8.0+git.1573597788.15b7984/_powerdns-install.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-PDN
  roles:
    - powerdns
  tasks:
    - include: roles/powerdns/tasks/install.yml
07070100000011000081A40000000000000000000000015DCB325C00000387000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/_powerdns-post-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.
#
---

# Configure PowerDNS database
- hosts: FND-MDB
  roles:
    - powerdns-post-configure
  # All these tasks should be set to run-once
  tasks:
    - include: roles/powerdns-post-configure/tasks/db_configure.yml
      when: ( 'FND_PDN' in verb_hosts )
07070100000012000081A40000000000000000000000015DCB325C000002DF000000000000000000000000000000000000004B00000000ardana-designate-8.0+git.1573597788.15b7984/_powerdns-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 powerdns services using ardana_notify_... variables
- hosts: all
  tasks:
    - include: roles/powerdns/tasks/_schedule_restart.yml07070100000013000081A40000000000000000000000015DCB325C000002DB000000000000000000000000000000000000003C00000000ardana-designate-8.0+git.1573597788.15b7984/bind-deploy.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: _bind-install.yml
- include: _bind-configure.yml
- include: bind-start.yml

07070100000014000081A40000000000000000000000015DCB325C000002BD000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/bind-reconfigure.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: _bind-configure.yml
- include: bind-start.yml
07070100000015000081A40000000000000000000000015DCB325C00000285000000000000000000000000000000000000003D00000000ardana-designate-8.0+git.1573597788.15b7984/bind-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: _bind-schedule-restart.yml

- include: bind-start.yml
07070100000016000081A40000000000000000000000015DCB325C000003D3000000000000000000000000000000000000003B00000000ardana-designate-8.0+git.1573597788.15b7984/bind-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.
#
---

- hosts: FND-BND
  roles:
    - bind
  tasks:
    - include: roles/bind/tasks/start.yml

# When everything is started, only then do we start to monitor.
# Intersection of hosts with the monasca agent and bind hosts
- hosts: "MON-AGN:&FND-BND"
  roles:
    - bind-monasca
  tasks:
    - include: roles/bind-monasca/tasks/start.yml
07070100000017000081A40000000000000000000000015DCB325C000002FB000000000000000000000000000000000000003C00000000ardana-designate-8.0+git.1573597788.15b7984/bind-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.
#
---

- hosts: FND-BND
  max_fail_percentage: 0
  roles:
    - bind
  tasks:
    - include: roles/bind/tasks/status.yml
07070100000018000081A40000000000000000000000015DCB325C000002E0000000000000000000000000000000000000003A00000000ardana-designate-8.0+git.1573597788.15b7984/bind-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.
#
---

- hosts: FND-BND
  roles:
    - bind
  tasks:
    - include: roles/bind/tasks/stop.yml
07070100000019000081A40000000000000000000000015DCB325C00000400000000000000000000000000000000000000003D00000000ardana-designate-8.0+git.1573597788.15b7984/bind-upgrade.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.
#

# During an upgrade a service restart notification may be set by:
#    install - e.g. new code, new package
#    configure - e.g. change to a configuration file
---
- include: bind-status.yml

# Install and configure services
- include: _bind-install.yml
- include: _bind-check-upgraded-packages.yml
- include: _bind-configure.yml
- include: bind-start.yml
- include: bind-status.yml
0707010000001A000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000003300000000ardana-designate-8.0+git.1573597788.15b7984/config0707010000001B000081A40000000000000000000000015DCB325C000003B2000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/config/bind-symlinks.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.
#
# The following relative symlinks are created under the
# my_cloud/config directory.
---

symlinks:
  "bind/named.conf.options.j2": "roles/bind/templates/named.conf.options.j2"
  "bind/named.conf.local.j2": "roles/bind/templates/named.conf.local.j2"
  "bind/rndc.key.j2": "roles/bind/templates/rndc.key.j2"
0707010000001C000081A40000000000000000000000015DCB325C00000749000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/config/designate-symlinks.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.
#
# The following relative symlinks are created under the
# my_cloud/config directory.
---

symlinks:
  "designate/designate.conf.j2": "roles/designate-common/templates/designate.conf.j2"
  "designate/rootwrap.conf.j2": "roles/designate-common/templates/rootwrap.conf.j2"
  "designate/policy.json": "roles/designate-common/files/policy.json"
  "designate/central.conf.j2": "roles/designate-central/templates/central.conf.j2"
  "designate/central-logging.conf.j2": "roles/designate-central/templates/central-logging.conf.j2"
  "designate/mdns.conf.j2": "roles/designate-mdns/templates/mdns.conf.j2"
  "designate/mdns-logging.conf.j2": "roles/designate-mdns/templates/mdns-logging.conf.j2"
  "designate/api.conf.j2": "roles/designate-api/templates/api.conf.j2"
  "designate/api-logging.conf.j2": "roles/designate-api/templates/api-logging.conf.j2"
  "designate/pool-manager.conf.j2": "roles/designate-pool-manager/templates/pool-manager.conf.j2"
  "designate/pool-manager-logging.conf.j2": "roles/designate-pool-manager/templates/pool-manager-logging.conf.j2"
  "designate/pools.yaml.j2": "roles/designate-pool-manager/templates/pools.yaml.j2"
  "designate/rndc.key.j2" : "roles/designate-pool-manager/templates/rndc.key.j2"
0707010000001D000081A40000000000000000000000015DCB325C00000326000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/config/powerdns-symlinks.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.
#
# The following relative symlinks are created under the
# my_cloud/config directory.
---

symlinks:
  "powerdns/pdns.conf.j2": "roles/powerdns/templates/pdns.conf.j2"
0707010000001E000081A40000000000000000000000015DCB325C00000445000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/designate-cloud-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.
#
---

- hosts: DES-API:&DES-PMG
  roles:
    - designate-cloud-configure
    - designate-pool-manager

  # All these tasks should be set to run-once
  tasks:
    - include: roles/designate-cloud-configure/tasks/pools_update.yml

- hosts: DES-API:&DES-WKR
  roles:
    - designate-cloud-configure
    - designate-worker

  # All these tasks should be set to run-once
  tasks:
    - include: roles/designate-cloud-configure/tasks/pools_update.yml
0707010000001F000081A40000000000000000000000015DCB325C0000033B000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/designate-deploy.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.
#
---

- include: _designate-install.yml
- include: _designate-configure.yml
- include: _designate-post-configure.yml
- include: designate-start.yml
- include: designate-cloud-configure.yml
07070100000020000081A40000000000000000000000015DCB325C0000047A000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/designate-reconfigure-credentials-change.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.
#
---
# mysql and rabbit passwords are changed centrally, we need to update the
# config files with the new values from the CP.
- include: _designate-configure.yml

# change keystone password
- hosts: DES-API
  roles:
    - designate-post-configure
  # This task should be set to run-once
  tasks:
    - include: roles/designate-post-configure/tasks/keystone_change_password.yml
      ansible_python_interpreter:
        "{{ KEY_CLI.vars.keystone_client_python_interpreter }}"

- include: designate-start.yml
07070100000021000081A40000000000000000000000015DCB325C0000031E000000000000000000000000000000000000004600000000ardana-designate-8.0+git.1573597788.15b7984/designate-reconfigure.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.
#
---

- include: _designate-configure.yml
- include: _designate-post-configure.yml
- include: designate-start.yml
- include: designate-cloud-configure.yml
07070100000022000081A40000000000000000000000015DCB325C0000028F000000000000000000000000000000000000004200000000ardana-designate-8.0+git.1573597788.15b7984/designate-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: _designate-schedule-restart.yml

- include: designate-start.yml
07070100000023000081A40000000000000000000000015DCB325C00000877000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/designate-start.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.
#
---

- hosts: DES-API
  roles:
    - designate-api
  tasks:
    - include: roles/designate-api/tasks/start.yml

- hosts: DES-CEN
  roles:
    - designate-central
  tasks:
    - include: roles/designate-central/tasks/start.yml

- hosts: DES-PMG
  roles:
    - designate-pool-manager
  tasks:
    - include: roles/designate-pool-manager/tasks/start.yml

- hosts: DES-ZMG
  roles:
    - designate-zone-manager
  tasks:
    - include: roles/designate-zone-manager/tasks/start.yml

- hosts: DES-WKR
  roles:
    - designate-worker
  tasks:
    - include: roles/designate-worker/tasks/start.yml

- hosts: DES-PDR
  roles:
    - designate-producer
  tasks:
    - include: roles/designate-producer/tasks/start.yml

- hosts: DES-MDN:DES-MDN-EXT
  roles:
    - designate-mdns
  tasks:
    - include: roles/designate-mdns/tasks/start.yml

# When everything is started, only then do we start to monitor.
# Intersection of hosts with the monasca agent and all designate hosts
- hosts: DES-API:DES-CEN:DES-MDN:DES-MDN-EXT:DES-PMG:DES-ZMG:&MON-AGN
  roles:
    - designate-monasca
  tasks:
    - include: roles/designate-monasca/tasks/start.yml

# Intersection of hosts with the monasca agent and designate api
- hosts: DES-API:&MON-AGN
  roles:
    - designate-monasca
  tasks:
    - include: roles/designate-monasca/tasks/local_monitor.yml

# Intersection of hosts with the monasca agent and monasca api
- hosts: DES-API:&MON-AGN
  roles:
    - designate-monasca
  tasks:
    - include: roles/designate-monasca/tasks/remote_monitor.yml
07070100000024000081A40000000000000000000000015DCB325C00000675000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/designate-status.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.
#
---

- hosts: DES-API
  max_fail_percentage: 0
  roles:
    - designate-api
  tasks:
    - include: roles/designate-api/tasks/status.yml

- hosts: DES-CEN
  max_fail_percentage: 0
  roles:
    - designate-central
  tasks:
    - include: roles/designate-central/tasks/status.yml

- hosts: DES-PMG
  max_fail_percentage: 0
  roles:
    - designate-pool-manager
  tasks:
    - include: roles/designate-pool-manager/tasks/status.yml

- hosts: DES-ZMG
  max_fail_percentage: 0
  roles:
    - designate-zone-manager
  tasks:
    - include: roles/designate-zone-manager/tasks/status.yml

- hosts: DES-WKR
  max_fail_percentage: 0
  roles:
    - designate-worker
  tasks:
    - include: roles/designate-worker/tasks/status.yml

- hosts: DES-PDR
  max_fail_percentage: 0
  roles:
    - designate-producer
  tasks:
    - include: roles/designate-producer/tasks/status.yml

- hosts: DES-MDN:DES-MDN-EXT
  max_fail_percentage: 0
  roles:
    - designate-mdns
  tasks:
    - include: roles/designate-mdns/tasks/status.yml
07070100000025000081A40000000000000000000000015DCB325C000005B8000000000000000000000000000000000000003F00000000ardana-designate-8.0+git.1573597788.15b7984/designate-stop.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.
#
---

- hosts: DES-API
  roles:
    - designate-api
  tasks:
    - include: roles/designate-api/tasks/stop.yml

- hosts: DES-CEN
  roles:
    - designate-central
  tasks:
    - include: roles/designate-central/tasks/stop.yml

- hosts: DES-PMG
  roles:
    - designate-pool-manager
  tasks:
    - include: roles/designate-pool-manager/tasks/stop.yml

- hosts: DES-ZMG
  roles:
    - designate-zone-manager
  tasks:
    - include: roles/designate-zone-manager/tasks/stop.yml

- hosts: DES-WKR
  roles:
    - designate-worker
  tasks:
    - include: roles/designate-worker/tasks/stop.yml

- hosts: DES-PDR
  roles:
    - designate-producer
  tasks:
    - include: roles/designate-producer/tasks/stop.yml

- hosts: DES-MDN:DES-MDN-EXT
  roles:
    - designate-mdns
  tasks:
    - include: roles/designate-mdns/tasks/stop.yml
07070100000026000081A40000000000000000000000015DCB325C000006FD000000000000000000000000000000000000004200000000ardana-designate-8.0+git.1573597788.15b7984/designate-upgrade.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.
#

# During an upgrade a service restart notification may be set by:
#    install - e.g. new code, new package
#    configure - e.g. change to a configuration file
---
- include: designate-status.yml

# Install and configure services in a new venv
- include: _designate-install.yml
- include: _designate-check-upgraded-packages.yml
- include: _designate-configure.yml

# Perform any database expand operations
- hosts: DES-CEN
  roles:
    - designate-post-configure
  tasks:
    - include: roles/designate-post-configure/tasks/db_expand.yml

# Configure Designate keystone resources
- hosts: DES-API
  roles:
    - designate-post-configure
  # This task should be set to run-once
  tasks:
    - include: roles/designate-post-configure/tasks/keystone_conf.yml
      ansible_python_interpreter: "{{ KEY_CLI.vars.keystone_client_python_interpreter }}"

# Restart services based on notifications set earlier
- include: designate-start.yml

# Perform any database contract operations
- hosts: DES-CEN
  roles:
    - designate-post-configure
  tasks:
    - include: roles/designate-post-configure/tasks/db_contract.yml

- include: designate-status.yml
07070100000027000081A40000000000000000000000015DCB325C0000030E000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/powerdns-deploy.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: _powerdns-install.yml
- include: _powerdns-configure.yml
- include: _powerdns-post-configure.yml
- include: powerdns-start.yml
07070100000028000081A40000000000000000000000015DCB325C000002ED000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/powerdns-reconfigure.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: _powerdns-configure.yml
- include: _powerdns-post-configure.yml
- include: powerdns-start.yml
07070100000029000081A40000000000000000000000015DCB325C0000028D000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/powerdns-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: _powerdns-schedule-restart.yml

- include: powerdns-start.yml
0707010000002A000081A40000000000000000000000015DCB325C000003E7000000000000000000000000000000000000003F00000000ardana-designate-8.0+git.1573597788.15b7984/powerdns-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.
#
---

- hosts: FND-PDN
  roles:
    - powerdns
  tasks:
    - include: roles/powerdns/tasks/start.yml

# When everything is started, only then do we start to monitor.
# Intersection of hosts with the monasca agent and powerdns hosts
- hosts: "MON-AGN:&FND-PDN"
  roles:
    - powerdns-monasca
  tasks:
    - include: roles/powerdns-monasca/tasks/start.yml
0707010000002B000081A40000000000000000000000015DCB325C00000303000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/powerdns-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.
#
---

- hosts: FND-PDN
  max_fail_percentage: 0
  roles:
    - powerdns
  tasks:
    - include: roles/powerdns/tasks/status.yml
0707010000002C000081A40000000000000000000000015DCB325C000002E8000000000000000000000000000000000000003E00000000ardana-designate-8.0+git.1573597788.15b7984/powerdns-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.
#
---

- hosts: FND-PDN
  roles:
    - powerdns
  tasks:
    - include: roles/powerdns/tasks/stop.yml
0707010000002D000081A40000000000000000000000015DCB325C00000440000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/powerdns-upgrade.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.
#

# During an upgrade a service restart notification may be set by:
#    install - e.g. new code, new package
#    configure - e.g. change to a configuration file
---
- include: powerdns-status.yml

# Install and configure services
- include: _powerdns-install.yml
- include: _powerdns-check-upgraded-packages.yml
- include: _powerdns-configure.yml
- include: _powerdns-post-configure.yml
- include: powerdns-start.yml
- include: powerdns-status.yml
0707010000002E000041ED0000000000000000000000125DCB325C00000000000000000000000000000000000000000000003200000000ardana-designate-8.0+git.1573597788.15b7984/roles0707010000002F000041ED0000000000000000000000085DCB325C00000000000000000000000000000000000000000000003700000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind07070100000030000041ED0000000000000000000000045DCB325C00000000000000000000000000000000000000000000003F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind-monasca07070100000031000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004400000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind-monasca/meta07070100000032000081A40000000000000000000000015DCB325C000002C9000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind-monasca/meta/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.
#
---
dependencies:
  - role: bind
  - {role: monasca-agent, run_mode: Use}
07070100000033000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind-monasca/tasks07070100000034000081A40000000000000000000000015DCB325C000002F3000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind-monasca/tasks/start.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.
#
---

- name: bind-monasca | start | Monitor the BIND process
  become: yes
  monasca_agent_plugin:
    name: "bind"
07070100000035000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/defaults07070100000036000081A40000000000000000000000015DCB325C00000673000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/defaults/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.
#
# This file will contain the default values for the Bind service
---

bind_conf_dir: /etc/bind
bind_local_conf_file: named.conf.local
bind_rndc_key_file: rndc.key

bind_process_name: named

# named.conf.options
## options section
bind_internal_host: "{{ host.bind.FND_BND.internal.ip_address }}"
bind_internal_port: "{{ host.bind.FND_BND.internal.port }}"
bind_public_host: "{{ host.bind.FND_BND_EXT.public.ip_address }}"
bind_public_port: "{{ host.bind.FND_BND_EXT.public.port }}"
bind_allow_notify: "{% if FND_BND.consumes_DES_MDN is defined -%}
                        {%- for mdns in FND_BND.consumes_DES_MDN.members.private -%}{{mdns.ip_address}}; {% endfor %}
                    {%- else -%}
                        none;
                    {%- endif %}"

## controls section
bind_rndc_allow: "0.0.0.0/0"
bind_rndc_host: "{{ host.bind.FND_BND.bind_rndc.ip_address }}"
bind_rndc_port: "{{ host.bind.FND_BND.bind_rndc.port }}"

# rndc.key
bind_rndc_key: "{{ FND_BND.vars.bind_rndc_key | b64encode }}"
07070100000037000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/handlers07070100000038000081A40000000000000000000000015DCB325C00000283000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/handlers/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.
#
---
07070100000039000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000003C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/meta0707010000003A000081A40000000000000000000000015DCB325C00000283000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/meta/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.
#
---
0707010000003B000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000003D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/tasks0707010000003C000081A40000000000000000000000015DCB325C0000030A000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/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: bind | _schedule_restart | Schedule a restart for bind services
  debug:
    msg: "Trigger a change notification in bind"
  changed_when: true
  register: ardana_notify_bind_restart_required0707010000003D000081A40000000000000000000000015DCB325C00000392000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/tasks/check_upgraded_packages.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.
#
---

- name: bind | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in bind package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: bind_restart_packages
  register: ardana_notify_bind_restart_required
0707010000003E000081A40000000000000000000000015DCB325C000008D1000000000000000000000000000000000000004B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/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.
#
# Configure the Bind service
---

- name: bind | configure | Write config file
  become: yes
  template:
    src: "named.conf.j2"
    dest: "{{ bind_named_conf_dir }}/{{ bind_main_conf_file }}"
    owner: "{{ bind_conf_owner }}"
    group: "{{ bind_conf_group }}"
    mode: 0640
  register: ardana_notify_bind_restart_required
  when: ansible_os_family | lower == 'suse'

- name: "bind | configure | Write config file"
  become: yes
  template:
    src: "named.conf.options.j2"
    dest: "{{ bind_conf_dir }}/{{ bind_main_conf_file }}"
    owner: "{{ bind_conf_owner }}"
    group: "{{ bind_conf_group }}"
    mode: 0600
  register: ardana_notify_bind_restart_required
  when: ansible_os_family | lower == 'debian'

- name: bind | configure | Write local config file
  become: yes
  template:
    src: "named.conf.local.j2"
    dest: "{{ bind_conf_dir }}/{{ bind_local_conf_file }}"
    owner: "{{ bind_conf_owner }}"
    group: "{{ bind_conf_group }}"
    mode: 0600
  register: ardana_notify_bind_restart_required
  when: ansible_os_family | lower == 'debian'

- name: bind | configure | Create directory for rndc key
  become: yes
  file:
    path: "{{ bind_conf_dir }}"
    owner: "{{ bind_conf_owner }}"
    group: "{{ bind_conf_group }}"
    mode: 0750
    state: directory
  when: ansible_os_family | lower == 'suse'

- name: "bind | configure | Write rndc key file"
  become: yes
  template:
    src: "rndc.key.j2"
    dest: "{{ bind_conf_dir }}/{{ bind_rndc_key_file }}"
    owner: "{{ bind_conf_owner }}"
    group: "{{ bind_conf_group }}"
    mode: 0600
  register: ardana_notify_bind_restart_required
0707010000003F000081A40000000000000000000000015DCB325C00000436000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/tasks/install.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.
#
# Install Bind service
---

- name: bind | install | Install Bind packages
  become: yes
  package:
    name: "{{ item }}"
    state: present
  with_items: bind_packages

- name: bind | install | Create logging directory '{{ bind_logging_dir }}'
  become: yes
  file:
    path: "{{ bind_logging_dir }}"
    owner: "{{ bind_system_user }}"
    group: "{{ bind_conf_group }}"
    mode: "a-rwx,u+rwx,g+rx,o+rx"
    state: directory
07070100000040000081A40000000000000000000000015DCB325C000002E9000000000000000000000000000000000000004600000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/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: bind | main | Set os-specific variables
  include_vars: "{{ ansible_os_family | lower }}.yml"
07070100000041000081A40000000000000000000000015DCB325C00000465000000000000000000000000000000000000004700000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/tasks/start.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.
#
# Restart or start the Bind service
---
- name: bind | start | Restart bind service
  become: yes
  service: name={{ bind_service_name }} state=restarted
  when: (ardana_notify_bind_restart_required is defined and ardana_notify_bind_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: bind | start | Start bind service
  become: yes
  service: name={{ bind_service_name }} state=started
07070100000042000081A40000000000000000000000015DCB325C000004D3000000000000000000000000000000000000004800000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/tasks/status.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.
#
# Show Bind service status

---

- name: bind | status | Print service being checked
  debug:
    msg: "Running service check for Bind"
  run_once: true

- name: bind | status | Check systemd service running
  command: systemctl status {{ bind_service_name }}
  ignore_errors: yes
  changed_when: false
  register: systemctl_status_result

- name: bind | status | Report status of Bind
  fail:
    msg: |
      bind is not running.
      systemctl status bind9 output:
      {{ systemctl_status_result.stdout }}
      {{ systemctl_status_result.stderr }}
  when: systemctl_status_result | failed
07070100000043000081A40000000000000000000000015DCB325C00000372000000000000000000000000000000000000004600000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/tasks/stop.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.
#
# Stop the Bind service
---
- name: bind | stop | stop bind service
  become: yes
  service: name={{ bind_service_name }} state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
07070100000044000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/templates07070100000045000081A40000000000000000000000015DCB325C0000093B000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/templates/named.conf.j2{#
#
# (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 file has been generated by ansible from
// bind/templates/named.conf.j2
// It contains the Ardana OpenStack values that apply only to the
// bind service. You may make changes to this file by adding
// sections below.


options {
       directory "{{ bind_zone_file_dir | quote }}";

       allow-new-zones yes;
       dnssec-validation auto;
       auth-nxdomain no;
       recursion no;
       minimal-responses yes;

       listen-on port {{ bind_internal_port }} { {{ bind_internal_host }}; };
       listen-on port {{ bind_public_port }} { {{ bind_public_host }}; };

       allow-notify { {{ bind_allow_notify }} };
};

key "rndc-key" {
       algorithm hmac-md5;
       secret "{{ bind_rndc_key }}";
};

controls {
       inet {{ bind_rndc_host }} port {{ bind_rndc_port }} allow { {{ bind_rndc_allow }}; } keys { "rndc-key"; };
};

logging {
       channel update_debug {
               file "{{ bind_logging_dir }}/updates.log" versions 10 size 10M;
               severity dynamic;
               print-severity  yes;
               print-time              yes;
       };
       channel security_info {
               file "{{ bind_logging_dir }}/security.log" versions 10 size 10M;
               severity dynamic;
               print-severity  yes;
               print-time              yes;
       };
       channel default_log {
               file "{{ bind_logging_dir }}/general.log" versions 10 size 10M;
               severity dynamic;
               print-category  yes;
               print-severity  yes;
               print-time              yes;
       };

       category default { default_log; };
       category update { update_debug; };
       category update-security { update_debug; };
       category security { security_info; };
};
07070100000046000081A40000000000000000000000015DCB325C0000068B000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/templates/named.conf.local.j2{#
#
# (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 file has been generated by ansible from
// bind/templates/named.conf.local.j2
// It contains the Ardana OpenStack values that apply only to the
// bind service. You may make changes to this file by adding
// sections/options below.

// Logging configuration
// http://www.zytrax.com/books/dns/ch7/logging.html
// Set "versions" to 99 keep log files indefinitely

logging {
	channel update_debug {
		file "{{ bind_logging_dir }}/updates.log" versions 10 size 10M;
		severity dynamic;
		print-severity	yes;
		print-time		yes;
	};
	channel security_info {
		file "{{ bind_logging_dir }}/security.log" versions 10 size 10M;
		severity dynamic;
		print-severity	yes;
		print-time		yes;
	};
	channel default_log {
		file "{{ bind_logging_dir }}/general.log" versions 10 size 10M;
		severity dynamic;
		print-category	yes;
		print-severity	yes;
		print-time		yes;
	};

	category default { default_log; };
	category update { update_debug; };
	category update-security { update_debug; };
	category security { security_info; };
};
07070100000047000081A40000000000000000000000015DCB325C00000591000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/templates/named.conf.options.j2{#
#
# (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.
#
#}

// This file has been generated by ansible from
// bind/templates/named.conf.options.j2
// It contains the Ardana OpenStack values that apply only to the
// bind service. You may make changes to this file by adding
// sections/options below.

include "{{ bind_conf_dir }}/{{ bind_rndc_key_file }}";

options {
	directory "{{ bind_zone_file_dir | quote }}";

	allow-new-zones yes;
	dnssec-validation auto;
	auth-nxdomain no;
	recursion no;
	minimal-responses yes;

	listen-on port {{ bind_internal_port }} { {{ bind_internal_host }}; };
	listen-on port {{ bind_public_port }} { {{ bind_public_host }}; };

	allow-notify { {{ bind_allow_notify }} };
};

controls {
	inet {{ bind_rndc_host }} port {{ bind_rndc_port }} allow { {{ bind_rndc_allow }}; } keys { "rndc-key"; };
};
07070100000048000081A40000000000000000000000015DCB325C000003BE000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/templates/rndc.key.j2{#
#
# (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 file has been generated by ansible from
// bind/templates/rndc.key.j2
// It contains the Ardana OpenStack values that apply only to the bind
// service. You may make changes to this file by adding
// sections/options below.

key "rndc-key" {
    algorithm hmac-md5;
    secret "{{ bind_rndc_key }}";
};

07070100000049000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000003C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/vars0707010000004A000081A40000000000000000000000015DCB325C000003FD000000000000000000000000000000000000004700000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/vars/debian.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.
#
---
bind_packages:
    - dnsutils
    - bind9
    - bind9utils

# packages listed here will trigger a restart of the service when updated
bind_restart_packages:
    - bind9

bind_logging_dir: /var/log/bind
bind_zone_file_dir: /var/cache/bind

bind_main_conf_file: named.conf.options

bind_conf_group: bind
bind_conf_owner: bind
bind_system_user: bind

bind_service_name: bind9
0707010000004B000081A40000000000000000000000015DCB325C0000042E000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/roles/bind/vars/suse.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.
#
---
bind_packages:
    - bind
    - bind-utils

# packages listed here will trigger a restart of the service when updated
bind_restart_packages:
    - bind

bind_named_conf_dir: /etc
bind_zone_file_dir: /var/lib/named
bind_logging_dir: /var/lib/named/log
bind_sysconfig_file: /etc/sysconfig/named

bind_main_conf_file: named.conf

bind_conf_group: named
bind_conf_owner: root
bind_system_user: named

bind_service_name: named
0707010000004C000041ED0000000000000000000000085DCB325C00000000000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api0707010000004D000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/defaults0707010000004E000081A40000000000000000000000015DCB325C00000818000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/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.
#
# This file will contain the default values for the designate-api service
---
designate_component: designate-api

# packages listed here will be installed by designate-common | install
designate_required_packages:
  - ca-certificates

# packages listed here will trigger a restart of the service when updated
designate_api_restart_packages:
  - ca-certificates

# api.conf
## [service:api]
designate_api_paste_config: "{{ designate_service_conf_dir }}/api-paste.ini"
designate_api_base_uri: "{{ DES_API.advertises.vips.public[0].url }}"
designate_api_listen: "{{ host.bind.DES_API.admin.ip_address }}:{{ host.bind.DES_API.admin.port }},{{ host.bind.DES_API.internal.ip_address }}:{{ host.bind.DES_API.internal.port }},{{ host.bind.DES_API.public.ip_address }}:{{ host.bind.DES_API.public.port }}"

## [keystone_authtoken]
designate_keystone_auth_url: "{{ DES_CEN.consumes_KEY_API.vips.private[0].url }}"
designate_keystone_auth_uri: "{{ DES_CEN.consumes_KEY_API.vips.private[0].url }}"
designate_admin_project_name: "{{ KEY_API.vars.keystone_service_tenant }}"
designate_project_domain_name: "{{ KEY_API.vars.keystone_default_domain }}"
designate_user_domain_name: "{{ KEY_API.vars.keystone_default_domain }}"
designate_admin_user: "{{ DES_CEN.consumes_KEY_API.vars.keystone_designate_user }}"
designate_admin_password: "{{ DES_CEN.consumes_KEY_API.vars.keystone_designate_password }}"

designate_enable_host_header: False
0707010000004F000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/files07070100000050000081A40000000000000000000000015DCB325C00000B18000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/files/api-paste.ini[composite:osapi_dns]
use = egg:Paste#urlmap
/: osapi_dns_versions
/v1: osapi_dns_v1
/v2: osapi_dns_v2
/admin: osapi_dns_admin

[composite:osapi_dns_versions]
use = call:designate.api.middleware:auth_pipeline_factory
noauth = http_proxy_to_wsgi cors maintenance faultwrapper osapi_dns_app_versions
keystone = http_proxy_to_wsgi cors maintenance faultwrapper osapi_dns_app_versions

[app:osapi_dns_app_versions]
paste.app_factory = designate.api.versions:factory

[composite:osapi_dns_v1]
use = call:designate.api.middleware:auth_pipeline_factory
noauth = http_proxy_to_wsgi cors request_id  noauthcontext maintenance validation_API_v1 faultwrapper normalizeuri osapi_dns_app_v1
keystone = http_proxy_to_wsgi cors request_id authtoken keystonecontext maintenance validation_API_v1 faultwrapper normalizeuri osapi_dns_app_v1


[app:osapi_dns_app_v1]
paste.app_factory = designate.api.v1:factory

[composite:osapi_dns_v2]
use = call:designate.api.middleware:auth_pipeline_factory
noauth = http_proxy_to_wsgi cors request_id faultwrapper validation_API_v2 noauthcontext maintenance normalizeuri osapi_dns_app_v2
keystone = http_proxy_to_wsgi cors request_id faultwrapper validation_API_v2 authtoken keystonecontext maintenance normalizeuri osapi_dns_app_v2

[app:osapi_dns_app_v2]
paste.app_factory = designate.api.v2:factory

[composite:osapi_dns_admin]
use = call:designate.api.middleware:auth_pipeline_factory
noauth = http_proxy_to_wsgi cors request_id faultwrapper noauthcontext maintenance normalizeuri osapi_dns_app_admin
keystone = http_proxy_to_wsgi cors request_id faultwrapper authtoken keystonecontext maintenance normalizeuri osapi_dns_app_admin

[app:osapi_dns_app_admin]
paste.app_factory = designate.api.admin:factory

[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = designate

[filter:request_id]
paste.filter_factory = oslo_middleware:RequestId.factory

[filter:http_proxy_to_wsgi]
paste.filter_factory = oslo_middleware:HTTPProxyToWSGI.factory

[filter:noauthcontext]
paste.filter_factory = designate.api.middleware:NoAuthContextMiddleware.factory

[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory

[filter:keystonecontext]
paste.filter_factory = designate.api.middleware:KeystoneContextMiddleware.factory

[filter:maintenance]
paste.filter_factory = designate.api.middleware:MaintenanceMiddleware.factory

[filter:normalizeuri]
paste.filter_factory = designate.api.middleware:NormalizeURIMiddleware.factory

[filter:faultwrapper]
paste.filter_factory = designate.api.middleware:FaultWrapperMiddleware.factory

[filter:validation_API_v1]
paste.filter_factory = designate.api.middleware:APIv1ValidationErrorMiddleware.factory

[filter:validation_API_v2]
paste.filter_factory = designate.api.middleware:APIv2ValidationErrorMiddleware.factory
07070100000051000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/handlers07070100000052000081A40000000000000000000000015DCB325C00000288000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/handlers/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.
#
---
07070100000053000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/meta07070100000054000081A40000000000000000000000015DCB325C000002AC000000000000000000000000000000000000004E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/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: designate-common
07070100000055000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/tasks07070100000056000081A40000000000000000000000015DCB325C000003B6000000000000000000000000000000000000006200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/tasks/check_upgraded_packages.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.
#
---

- name: designate-api | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in designate-api package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_api_restart_packages
  register: ardana_notify_designate_api_restart_required
07070100000057000081A40000000000000000000000015DCB325C00000A18000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/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.
#
# Configure the designate-api service
---

- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_api_venv_changed }}"

- include: ../../designate-common/tasks/configure.yml

- name: "designate-api | configure | Notify on rootwrap change"
  shell: echo "notify rootwrap change"
  when: rootwrap_changed
  register: ardana_notify_designate_api_restart_required

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-api/templates/api.conf.j2"
  dest: "api.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-api | configure | Notify on api.conf change"
  shell: echo "notify change"
  when: write_conf_result.changed
  register: ardana_notify_designate_api_restart_required

- name: "designate-api | configure | Apply template: {{ item }}"
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - "api-logging.conf"
  register: ardana_notify_designate_api_restart_required

- name: "designate-api | configure | Copy files to '{{ designate_service_conf_dir }}'"
  become: yes
  copy:
    src: "{{ item }}"
    dest: "{{ designate_service_conf_dir }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - api-paste.ini
  register: ardana_notify_designate_api_restart_required

- name: "designate-api | configure | set designate log file ownership"
  become: yes
  file:
    path: "{{ designate_log_file_location }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_log_file_group }}"
    mode: 0640
    state: touch
  with_items:
    - designate-api.log
    - designate-api-json.log
07070100000058000081A40000000000000000000000015DCB325C0000083A000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/tasks/install.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.
#
# Install designate-api service
---

- name: designate-api | install | Update installed packager cache
  become: yes
  install_package:
    cache: update

- name: designate-api | install | Install the designate-api service from the designate venv
  become: yes
  install_package:
    name: designate
    service: designate-api
    state: present
    activate: act_off
  register: ardana_notify_designate_api_venv_changed

- name: "designate-api | install | Notify for restart on venv change"
  shell: echo "notify venv change"
  register: ardana_notify_designate_api_restart_required
  when: ardana_notify_designate_api_venv_changed.changed

- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_api_venv_changed  }}"

- name: designate-api | install | Setup designate-api service
  become: yes
  setup_systemd:
    service: designate-api
    user: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    cmd: designate-api
    args: >
      --config-file={{ designate_service_conf_dir }}/designate.conf
      --config-file={{ designate_service_conf_dir }}/api.conf

- name: designate-api | install | Set designate-api service to not start on boot
  become: yes
  service:
    name: designate-api
    enabled: no

# This must happen after the install_package, or a path which is meant to be a
# symlink will be mkdir'd
- include: ../../designate-common/tasks/install.yml
07070100000059000081A40000000000000000000000015DCB325C000005C4000000000000000000000000000000000000005000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/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.
#
# Restart or start the designate-api service
---

- name: designate-api | start | Activate the latest installed version
  become: yes
  install_package:
    name: designate
    service: designate-api
    activate: act_on
    version: "{{ ardana_notify_designate_api_venv_changed.version }}"
  when: ardana_notify_designate_api_venv_changed is defined

- name: designate-api | start | Restart designate-api service
  become: yes
  service: name=designate-api state=restarted
  when: (ardana_notify_designate_api_restart_required is defined and ardana_notify_designate_api_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: designate-api | start | Start designate-api service
  become: yes
  service: name=designate-api state=started
0707010000005A000081A40000000000000000000000015DCB325C000002C0000000000000000000000000000000000000005100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/tasks/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.
#
---

- include: ../../designate-common/tasks/_service_status.yml
0707010000005B000081A40000000000000000000000015DCB325C00000383000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/tasks/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.
#
# Stop the designate-api service
---
- name: designate-api | stop | stop designate-api service
  become: yes
  service: name=designate-api state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
0707010000005C000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/templates0707010000005D000081A40000000000000000000000015DCB325C00000693000000000000000000000000000000000000005E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/templates/api-logging.conf.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.
#
#}
[loggers]
keys: root

[handlers]
keys: watchedfile, logstash

[formatters]
keys: context, logstash


[logger_root]
qualname: root
handlers: watchedfile, logstash
level: NOTSET


# Writes to disk
[handler_watchedfile]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-api.log',)
formatter: context
level: INFO

# Writes JSON to disk, beaver will ship to logstash
[handler_logstash]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-api-json.log',)
formatter: logstash
level: INFO

# datefmt must be set otherwise you end up with too many (msecs) fields
[formatter_context]
class: oslo_log.formatters.ContextFormatter
args: (datefmt=datefmt)
format: %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(tenant)s] %(instance)s%(message)s
datefmt: %Y-%m-%d %H:%M:%S

# the "format" and "datefmt" actually set the "type" and "tags"
[formatter_logstash]
class: logstash.LogstashFormatterVersion1
format: designate
datefmt: designate-api
0707010000005E000081A40000000000000000000000015DCB325C0000077C000000000000000000000000000000000000005600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/templates/api.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.
#
#}
# This file has the Ardana Openstack values that apply only to the 
# Designate API service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
# Logging
log_config_append = "{{ designate_service_conf_dir }}/api-logging.conf"

# Oslo Messaging
notify_api_faults = True

auth_strategy = keystone

# End of [DEFAULT] section

[service:api]
api_paste_config = {{ designate_api_paste_config }}
api_base_uri = {{ designate_api_base_uri }}
listen = {{ designate_api_listen }}

enable_host_header = {{ designate_enable_host_header }}
enable_api_v1 = True
enable_api_v2 = True
enable_api_admin = True
enabled_extensions_v1 = quotas, touch
#enabled_extensions_v2 =
enabled_extensions_admin = quotas, zones


[keystone_authtoken]
cafile = {{ trusted_ca_bundle }}
auth_type = password
auth_url = {{ designate_keystone_auth_url }}
auth_uri = {{ designate_keystone_auth_uri }}
project_name = {{ designate_admin_project_name }}
project_domain_name = {{ designate_project_domain_name }}
user_domain_name = {{ designate_user_domain_name }}
username = {{ designate_admin_user }}
password = {{ designate_admin_password }}
service_token_roles_required = true
service_token_roles = admin

### End of File ###
## Do NOT put anything after this line ##
0707010000005F000081A40000000000000000000000015DCB325C000006C9000000000000000000000000000000000000006400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-api/templates/designate_neutron.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.
#
#}
# This configuration file includes the default values for Ardana Openstack
# Changes may be made to this file by the customer.

[designate]
url = {{ DES_API.advertises.vips.private[0].url }}/v2
admin_auth_url = {{ DES_CEN.consumes_KEY_API.vips.private[0].url }}
admin_username = {{ DES_CEN.consumes_KEY_API.vars.keystone_designate_user }}
admin_password = {{ DES_CEN.consumes_KEY_API.vars.keystone_designate_password }}
admin_tenant_name = {{ KEY_API.vars.keystone_service_tenant }}
auth_type = password
auth_uri = {{ DES_CEN.consumes_KEY_API.vips.private[0].url }}
auth_url = {{ DES_CEN.consumes_KEY_API.vips.private[0].url }}
project_domain_name = {{ KEY_API.vars.keystone_default_domain }}
user_domain_name = {{ KEY_API.vars.keystone_default_domain }}
project_name = {{ KEY_API.vars.keystone_service_tenant }}
username = {{ DES_CEN.consumes_KEY_API.vars.keystone_designate_user }}
password = {{ DES_CEN.consumes_KEY_API.vars.keystone_designate_password }}
allow_reverse_dns_lookup = True
ipv4_ptr_zone_prefix_size = 24
ipv6_ptr_zone_prefix_size = 116
cafile = {{ trusted_ca_bundle }}
07070100000060000041ED0000000000000000000000075DCB325C00000000000000000000000000000000000000000000004400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central07070100000061000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/defaults07070100000062000081A40000000000000000000000015DCB325C0000051E000000000000000000000000000000000000005600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/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.
#
# This file will contain the default values for the designate-central service
---
designate_component: designate-central

# packages listed here will be installed by designate-common | install
designate_required_packages:
  - libmysqlclient18

# packages listed here will trigger a restart of the service when updated
designate_central_restart_packages:
  - libmysqlclient18

# Used exclusivly for designate-post-configure's designate-manage calls
designate_central_etc_dir: "{{ designate_component | config_dir() }}"
designate_central_conf_dir: "{{ designate_component | config_dir() }}/designate"
designate_central_bin_dir: "{{ designate_component | bin_dir() }}"
07070100000063000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/handlers07070100000064000081A40000000000000000000000015DCB325C00000288000000000000000000000000000000000000005600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/handlers/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.
#
---
07070100000065000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/meta07070100000066000081A40000000000000000000000015DCB325C000002AC000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/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: designate-common
07070100000067000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/tasks07070100000068000081A40000000000000000000000015DCB325C000003C6000000000000000000000000000000000000006600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/tasks/check_upgraded_packages.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.
#
---

- name: designate-central | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in designate-central package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_central_restart_packages
  register: ardana_notify_designate_central_restart_required
07070100000069000081A40000000000000000000000015DCB325C00000827000000000000000000000000000000000000005800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/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.
#
# Configure the designate-central service
---
- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_central_venv_changed }}"

- include: ../../designate-common/tasks/configure.yml

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-central/templates/central.conf.j2"
  dest: "central.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-central | configure | notify on central.conf change"
  shell: echo "notify change"
  register: ardana_notify_designate_central_restart_required
  when: write_conf_result.changed

- name: "designate-central | configure | Apply template: {{ item }}"
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - "central-logging.conf"
  register: ardana_notify_designate_central_restart_required

- name: "designate-central | configure | set designate log file ownership"
  become: yes
  file:
    path: "{{ designate_log_file_location }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_log_file_group }}"
    mode: 0640
    state: touch
  with_items:
    - designate-central.log
    - designate-central-json.log
0707010000006A000081A40000000000000000000000015DCB325C00000A62000000000000000000000000000000000000005600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/tasks/install.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.
#
# Install designate-central service
---

- name: designate-central | install | Update installed packager cache
  become: yes
  install_package:
    cache: update

- name: designate-central | install | Install the designate-central service from the designate venv
  become: yes
  install_package:
    name: designate
    service: designate-central
    state: present
    activate: act_off
  register: ardana_notify_designate_central_venv_changed

- name: "designate-central | install | Notify for restart on venv change"
  shell: echo "notify venv change"
  register: ardana_notify_designate_central_restart_required
  when: ardana_notify_designate_central_venv_changed.changed



- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_central_venv_changed }}"

- name: designate-central | install | set service directories
  set_fact:
    designate_central_etc_dir:
      "{{ designate_component | config_dir(ardana_notify_designate_central_venv_changed.version) }}"
    designate_central_conf_dir:
      "{{ designate_component | config_dir(ardana_notify_designate_central_venv_changed.version) }}/designate"
    designate_central_bin_dir:
      "{{ designate_component | bin_dir(ardana_notify_designate_central_venv_changed.version) }}"

- name: designate-central | install | Setup designate-central service
  become: yes
  setup_systemd:
    service: designate-central
    user: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    cmd: designate-central
    args: >
      --config-file={{ designate_service_conf_dir }}/designate.conf
      --config-file={{ designate_service_conf_dir }}/central.conf

- name: designate-central | install | Set designate-central service to not start on boot
  become: yes
  service:
    name: designate-central
    enabled: no

# This must happen after the install_package, or a path which is meant to be a
# symlink will be mkdir'd
- include: ../../designate-common/tasks/install.yml
0707010000006B000081A40000000000000000000000015DCB325C000005F8000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/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.
#
# Restart or start the designate-central service
---

- name: designate-central | start | Activate the latest installed version
  become: yes
  install_package:
    name: designate
    service: designate-central
    activate: act_on
    version: "{{ ardana_notify_designate_central_venv_changed.version }}"
  when: ardana_notify_designate_central_venv_changed is defined

- name: designate-central | start | Restart designate-central service
  become: yes
  service: name=designate-central state=restarted
  when: (ardana_notify_designate_central_restart_required is defined and ardana_notify_designate_central_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: designate-central | start | Start designate-central service
  become: yes
  service: name=designate-central state=started
0707010000006C000081A40000000000000000000000015DCB325C000002C0000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/tasks/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.
#
---

- include: ../../designate-common/tasks/_service_status.yml
0707010000006D000081A40000000000000000000000015DCB325C00000393000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/tasks/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.
#
# Stop the designate-central service
---
- name: designate-central | stop | stop designate-central service
  become: yes
  service: name=designate-central state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
0707010000006E000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/templates0707010000006F000081A40000000000000000000000015DCB325C000006A0000000000000000000000000000000000000006600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/templates/central-logging.conf.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.
#
#}
[loggers]
keys: root

[handlers]
keys: watchedfile, logstash

[formatters]
keys: context, logstash


[logger_root]
qualname: root
handlers: watchedfile, logstash
level: NOTSET


# Writes to disk
[handler_watchedfile]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-central.log',)
formatter: context
level: INFO

# Writes JSON to disk, beaver will ship to logstash
[handler_logstash]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-central-json.log',)
formatter: logstash
level: INFO

# datefmt must be set otherwise you end up with too many (msecs) fields
[formatter_context]
class: oslo_log.formatters.ContextFormatter
args: (datefmt=datefmt)
format: %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(tenant)s] %(instance)s%(message)s
datefmt: %Y-%m-%d %H:%M:%S

# the "format" and "datefmt" actually set the "type" and "tags"
[formatter_logstash]
class: logstash.LogstashFormatterVersion1
format: designate
datefmt: designate-central
07070100000070000081A40000000000000000000000015DCB325C00000442000000000000000000000000000000000000005E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-central/templates/central.conf.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.
#
#}
# This file has the Ardana Openstack values that apply only to the Designate
# Central service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
# Logging
log_config_append = "{{ designate_service_conf_dir }}/central-logging.conf"

# End of [DEFAULT] section

[network_api:neutron]
endpoint_type = internalURL

# End of [network_api:neutron] section

### End of File ###
## Do NOT put anything after this line ##
07070100000071000041ED0000000000000000000000055DCB325C00000000000000000000000000000000000000000000004C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-cloud-configure07070100000072000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-cloud-configure/defaults07070100000073000081A40000000000000000000000015DCB325C00000283000000000000000000000000000000000000005E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-cloud-configure/defaults/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.
#
---
07070100000074000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-cloud-configure/meta07070100000075000081A40000000000000000000000015DCB325C000002EE000000000000000000000000000000000000005A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-cloud-configure/meta/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.
#
---

dependencies:
  - role: designate-common
  - role: designate-pool-manager
  - role: designate-worker
07070100000076000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-cloud-configure/tasks07070100000077000081A40000000000000000000000015DCB325C00000645000000000000000000000000000000000000006300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-cloud-configure/tasks/pools_update.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: designate-cloud-configure | pools_update | Run designate-manage pool update
  become: yes
  become_user: "{{ designate_system_user }}"
  command: >
    {{ designate_pool_manager_bin_dir }}/designate-manage
    --config-file {{ designate_pool_manager_conf_dir }}/designate.conf
    --config-file {{ designate_pool_manager_conf_dir }}/pool-manager.conf
    pool update
    --file {{ designate_pool_manager_conf_dir }}/pools.yaml
  run_once: true
  when: verb_hosts.DES_PMG is defined

- name: designate-cloud-configure | pools_update | Run designate-manage pool update
  become: yes
  become_user: "{{ designate_system_user }}"
  command: >
    {{ designate_worker_bin_dir }}/designate-manage
    --config-file {{ designate_worker_conf_dir }}/designate.conf
    --config-file {{ designate_worker_conf_dir }}/worker.conf
    pool update
    --file {{ designate_worker_conf_dir }}/pools.yaml
  run_once: true
  when: verb_hosts.DES_WKR is defined
07070100000078000041ED0000000000000000000000085DCB325C00000000000000000000000000000000000000000000004300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common07070100000079000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/defaults0707010000007A000081A40000000000000000000000015DCB325C000009A5000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/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.
#
# This file will contain the default values for designate
---

designate_system_group: designate
designate_system_user: designate
designate_system_createhome: false
designate_system_shell: /bin/false

designate_state_root_dir: /
designate_system_home_folder: "{{ designate_state_root_dir }}/var/lib/designate"

### Logging
designate_log_file_location: "{{ designate_state_root_dir }}/var/log/designate"
designate_log_file_group: adm

# designate.conf
## [DEFAULT]
### General
designate_state_path: "{{ designate_state_root_dir }}/var/lib/designate"
designate_rootwrap_config: "{{ designate_service_conf_dir }}/rootwrap.conf"


### RabbitMQ
rabbit:
  hosts: "{% for x in DES.consumes_FND_RMQ.members.private %}{{ x.host }}:{{ x.port }}{%if not loop.last %},{% endif %}{% endfor %}"
  rmq_service_user: "{{ DES.consumes_FND_RMQ.vars.accounts.designate.username }}"
  rmq_service_password: "{{ DES.consumes_FND_RMQ.vars.accounts.designate.password }}"
  rmq_use_ssl: "{{ DES.consumes_FND_RMQ.members.private[0].use_tls }}"

## [oslo_policy]
designate_policy_file: "{{ designate_service_conf_dir }}/policy.json"

## [oslo_concurrency]
designate_lock_path: "{{ designate_state_root_dir }}/var/lib/designate/lock"

## [storage:sqlalchemy]
_designate_database_ca_file: "{{ trusted_ca_bundle }}"
### mysql
mysql:
  db_ssl: "{% if DES_CEN.consumes_FND_MDB.vips.private[0].use_tls %}?ssl_ca={{ _designate_database_ca_file }}{% endif %}"
  host: "{{ DES_CEN.consumes_FND_MDB.vips.private[0].host }}"
  admin_user: "{{ DES_CEN.consumes_FND_MDB.vars.accounts.designate.username }}"
  admin_password: "{{ DES_CEN.consumes_FND_MDB.vars.accounts.designate.password | quote }}"

designate_database_connection: "mysql+pymysql://{{ mysql.admin_user }}:{{ mysql.admin_password | urlencode }}@{{ mysql.host }}/designate{{ mysql.db_ssl }}"
0707010000007B000041ED0000000000000000000000035DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/files0707010000007C000081A40000000000000000000000015DCB325C00001278000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/files/policy.json{
    "admin": "role:admin or role:designate_admin or is_admin:True",
    "primary_zone": "target.zone_type:SECONDARY",

    "owner": "tenant:%(tenant_id)s",
    "admin_or_owner": "rule:admin or rule:owner",
    "target": "tenant:%(target_tenant_id)s",
    "owner_or_target":"rule:target or rule:owner",
    "admin_or_owner_or_target":"rule:owner_or_target or rule:admin",
    "admin_or_target":"rule:admin or rule:target",

    "zone_primary_or_admin": "('PRIMARY':%(zone_type)s and rule:admin_or_owner) OR ('SECONDARY':%(zone_type)s AND is_admin:True)",

    "default": "rule:admin_or_owner",

    "all_tenants": "rule:admin",

    "edit_managed_records" : "rule:admin",

    "use_low_ttl": "rule:admin",

    "get_quotas": "rule:admin_or_owner",
    "get_quota": "rule:admin_or_owner",
    "set_quota": "rule:admin",
    "reset_quotas": "rule:admin",

    "create_tld": "rule:admin",
    "find_tlds": "rule:admin",
    "get_tld": "rule:admin",
    "update_tld": "rule:admin",
    "delete_tld": "rule:admin",

    "create_tsigkey": "rule:admin",
    "find_tsigkeys": "rule:admin",
    "get_tsigkey": "rule:admin",
    "update_tsigkey": "rule:admin",
    "delete_tsigkey": "rule:admin",

    "find_tenants": "rule:admin",
    "get_tenant": "rule:admin",
    "count_tenants": "rule:admin",

    "create_zone": "rule:admin_or_owner",
    "get_zones": "rule:admin_or_owner",
    "get_zone": "rule:admin_or_owner",
    "get_zone_servers": "rule:admin_or_owner",
    "find_zones": "rule:admin_or_owner",
    "find_zone": "rule:admin_or_owner",
    "update_zone": "rule:admin_or_owner",
    "delete_zone": "rule:admin_or_owner",
    "xfr_zone": "rule:admin_or_owner",
    "abandon_zone": "rule:admin",
    "count_zones": "rule:admin_or_owner",
    "count_zones_pending_notify": "rule:admin_or_owner",
    "purge_zones": "rule:admin",
    "touch_zone": "rule:admin_or_owner",

    "create_recordset": "rule:zone_primary_or_admin",
    "get_recordsets": "rule:admin_or_owner",
    "get_recordset": "rule:admin_or_owner",
    "find_recordsets": "rule:admin_or_owner",
    "find_recordset": "rule:admin_or_owner",
    "update_recordset": "rule:zone_primary_or_admin",
    "delete_recordset": "rule:zone_primary_or_admin",
    "count_recordset": "rule:admin_or_owner",

    "create_record": "rule:admin_or_owner",
    "get_records": "rule:admin_or_owner",
    "get_record": "rule:admin_or_owner",
    "find_records": "rule:admin_or_owner",
    "find_record": "rule:admin_or_owner",
    "update_record": "rule:admin_or_owner",
    "delete_record": "rule:admin_or_owner",
    "count_records": "rule:admin_or_owner",

    "use_sudo": "rule:admin",

    "create_blacklist": "rule:admin",
    "find_blacklist": "rule:admin",
    "find_blacklists": "rule:admin",
    "get_blacklist": "rule:admin",
    "update_blacklist": "rule:admin",
    "delete_blacklist": "rule:admin",
    "use_blacklisted_zone": "rule:admin",

    "create_pool": "rule:admin",
    "find_pools": "rule:admin",
    "find_pool": "rule:admin",
    "get_pool": "rule:admin",
    "update_pool": "rule:admin",
    "delete_pool": "rule:admin",
    "zone_create_forced_pool": "rule:admin",

    "diagnostics_ping": "rule:admin",
    "diagnostics_sync_zones": "rule:admin",
    "diagnostics_sync_zone": "rule:admin",
    "diagnostics_sync_record": "rule:admin",

    "create_zone_transfer_request": "rule:admin_or_owner",
    "get_zone_transfer_request": "rule:admin_or_owner or tenant:%(target_tenant_id)s or None:%(target_tenant_id)s",
    "get_zone_transfer_request_detailed": "rule:admin_or_owner",
    "find_zone_transfer_requests": "@",
    "find_zone_transfer_request": "@",
    "update_zone_transfer_request": "rule:admin_or_owner",
    "delete_zone_transfer_request": "rule:admin_or_owner",

    "create_zone_transfer_accept": "rule:admin_or_owner or tenant:%(target_tenant_id)s or None:%(target_tenant_id)s",
    "get_zone_transfer_accept": "rule:admin_or_owner",
    "find_zone_transfer_accepts": "rule:admin",
    "find_zone_transfer_accept": "rule:admin",
    "update_zone_transfer_accept": "rule:admin",
    "delete_zone_transfer_accept": "rule:admin",

    "create_zone_import": "rule:admin_or_owner",
    "find_zone_imports": "rule:admin_or_owner",
    "get_zone_import": "rule:admin_or_owner",
    "update_zone_import": "rule:admin_or_owner",
    "delete_zone_import": "rule:admin_or_owner",

    "zone_export": "rule:admin_or_owner",
    "create_zone_export": "rule:admin_or_owner",
    "find_zone_exports": "rule:admin_or_owner",
    "get_zone_export": "rule:admin_or_owner",
    "update_zone_export": "rule:admin_or_owner",

    "find_service_status": "rule:admin",
    "find_service_statuses": "rule:admin",
    "update_service_service_status": "rule:admin"
}
0707010000007D000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/files/rootwrap.d0707010000007E000081A40000000000000000000000015DCB325C00000126000000000000000000000000000000000000006200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/files/rootwrap.d/bind9.filters# designate-rootwrap command filters for nodes on which designate is
# expected to control network
#
# This file should be owned by (and only-writeable by) the root user

# format seems to be
# cmd-name: filter-name, raw-command, user, args

[Filters]
rndc: CommandFilter, /usr/sbin/rndc, root
0707010000007F000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/handlers07070100000080000081A40000000000000000000000015DCB325C00000288000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/handlers/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.
#
---
07070100000081000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/meta07070100000082000081A40000000000000000000000015DCB325C000002A9000000000000000000000000000000000000005100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/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: tls-vars
07070100000083000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks07070100000084000081A40000000000000000000000015DCB325C00000458000000000000000000000000000000000000005F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/_configure_policy.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.
#
---

- debug:
    msg: "Running designate-common _configure_policy for {{ designate_component }}"
    when: designate_component is defined
    run_once: true

- name: designate-common | _configure_policy | Copy the policy file
  become: yes
  copy:
    src: "policy.json"
    dest: "{{ designate_service_conf_dir }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  register: ardana_notify_designate_restart_required
07070100000085000081A40000000000000000000000015DCB325C00000ACE000000000000000000000000000000000000006100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/_configure_rootwrap.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.
#
# designate-common | _configure_rootwrap
---

- debug:
    msg: "Running designate-common _configure_rootwrap for {{ designate_component }}"
    when: designate_component is defined
    run_once: true

# this has to be in the /etc/sudoers.d of the host - not the venv!
- name: designate-common | _configure_rootwrap | Setup designate user to allow sudo to run designate-rootwrap without password
  become: yes
  template:
    src: designate-rootwrap.j2
    dest: /etc/sudoers.d/designate-rootwrap
    owner: root
    group: root
    mode: 0440
    validate: 'visudo -cf %s'
  register: allow_sudo_result

# DO NOT register for the symbolic link creation - it changes every time
- name: designate-common | _configure_rootwrap | Create a symbolic link between filesystem and venv for designate-rootwrap
  become: yes
  file:
    src: "{{ designate_service_bin_dir }}/designate-rootwrap"
    dest: /usr/local/bin/designate-rootwrap
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    state: link

- name: designate-common | _configure_rootwrap | Create directory for rootwrap filters.
  become: yes
  file:
    path: "{{ designate_service_conf_dir }}/rootwrap.d"
    owner: root
    group: root
    mode: 0755
    state: directory
  register: create_dir_result

- name: designate-common | _configure_rootwrap | Apply rootwrap template
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "root"
    group: "root"
    mode: 0644
  with_items:
    - rootwrap.conf
  register: apply_template_result

- name: designate-common | _configure_rootwrap | Copy the rootwrap filters
  become: yes
  copy:
    src: "{{ item }}"
    dest: "{{ designate_service_conf_dir }}/rootwrap.d"
    owner: "root"
    group: "root"
    mode: 0644
  with_items:
    designate_rootwrap_filters
  register: copy_filters_result

- name: designate-common | _configure_rootwrap | Summarise rootwrap results
  set_fact:
    rootwrap_changed: allow_sudo_result.changed or create_dir_result.changed or apply_template_result.changed or copy_filters_result.changed
07070100000086000081A40000000000000000000000015DCB325C0000031F000000000000000000000000000000000000005F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/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: designate-common | _schedule_restart | Schedule a restart for all services
  debug:
    msg: "Trigger a change notification in designate"
  changed_when: true
  register: ardana_notify_designate_restart_required07070100000087000081A40000000000000000000000015DCB325C0000054F000000000000000000000000000000000000005D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/_service_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.
#
---

- name: designate-common | _service_status | Print service being checked
  debug:
    msg: "Running service check for {{ designate_component }}"
  run_once: true

- name: designate-common | _service_status | Check systemd service running
  command: systemctl status "{{ designate_component }}"
  ignore_errors: yes
  changed_when: false
  register: systemctl_status_result

- name: designate-common | _service_status | Report status of "{{ designate_component }}"
  fail:
    msg: |
      {{ designate_component }} is not running.
      systemctl status {{ designate_component }} output:
      {{ systemctl_status_result.stdout }}
      {{ systemctl_status_result.stderr }}
  when: systemctl_status_result | failed
07070100000088000081A40000000000000000000000015DCB325C000005E7000000000000000000000000000000000000005E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/_set_directories.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.
#
#
---

- name: designate-common | _set_directories | set service etc directory - configure
  set_fact:
    designate_service_etc_dir:
      "{{ designate_component | config_dir(install_package_result.version) }}"
    designate_service_conf_dir:
      "{{ designate_component | config_dir(install_package_result.version) }}/designate"
    designate_service_bin_dir:
      "{{ designate_component | bin_dir(install_package_result.version) }}"
  when: install_package_result.version is defined

- name: designate-common | _set_directories | set service etc directory - reconfigure
  set_fact:
    designate_service_etc_dir: "{{ designate_component | config_dir() }}"
    designate_service_conf_dir: "{{ designate_component | config_dir() }}/designate"
    designate_service_bin_dir: "{{ designate_component | bin_dir() }}"
  when: install_package_result.version is undefined
07070100000089000081A40000000000000000000000015DCB325C000007BB000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/_write_conf.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: "designate-common | _write_conf | Check for pre-existing version of {{ dest }}"
  stat: path="{{ designate_service_conf_dir }}/{{ dest }}"
  register: conf_stat_result

- name: "designate-common | _write_conf | get timestamp"
  command: date +%Y%m%d%H%M%S
  register: time_result

- name: "designate-common | _write_conf | Create a backup version of the existing {{ dest }} file"
  become: yes
  command: cp {{ designate_service_conf_dir }}/{{ dest }} {{ designate_service_conf_dir }}/{{ dest }}.{{ time_result.stdout }}
  when: conf_stat_result.stat.exists

- name: "designate-common | _write_conf | Template {{ dest }}"
  become: yes
  template:
    src: "{{ src }}"
    dest: "{{ designate_service_conf_dir }}/{{ dest }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0600
  register: write_conf_result

- name: "designate-common | _write_conf | Delete backup file that has not changed."
  become: yes
  file:
    path: "{{ designate_service_conf_dir }}/{{ dest }}.{{ time_result.stdout }}"
    state: absent
  when: write_conf_result.changed==false

- name: "designate-common | _write_conf | remove all but last 10 backups of {{ dest }}"
  become: yes
  shell: ls -td {{ designate_service_conf_dir }}/{{ dest }}.* |awk 'NR>10' |xargs rm -f
  when: conf_stat_result.stat.exists
0707010000008A000081A40000000000000000000000015DCB325C00000900000000000000000000000000000000000000006300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/_write_conf_delegated.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: "designate-common | _write_conf_delegated | Check for pre-existing version of {{ dest }}"
  stat: path="{{ designate_service_conf_dir }}/{{ dest }}"
  register: conf_stat_result
  delegate_to: "{{ item }}"
  with_items: "{{ delegate }}"

- name: "designate-common | _write_conf_delegated | get timestamp"
  command: date +%Y%m%d%H%M%S
  register: time_result

- name: "designate-common | _write_conf_delegated | Create a backup version of the existing {{ dest }} file"
  command: cp {{ designate_service_conf_dir }}/{{ dest }} {{ designate_service_conf_dir }}/{{ dest }}.{{ time_result.stdout }}
  when: item.stat.exists
  delegate_to: "{{ item.item }}"
  with_items: "{{ conf_stat_result.results }}"

- name: "designate-common | _write_conf_delegated | Template {{ dest }}"
  template:
    src: "{{ src }}"
    dest: "{{ designate_service_conf_dir }}/{{ dest }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0600
  register: write_conf_result
  delegate_to: "{{ item }}"
  with_items: "{{ delegate }}"

- name: "designate-common | _write_conf_delegated | Delete backup file that has not changed."
  file:
    path: "{{ designate_service_conf_dir }}/{{ dest }}.{{ time_result.stdout }}"
    state: absent
  when: item.changed==false
  delegate_to: "{{ item.item }}"
  with_items: "{{ write_conf_result.results }}"

- name: "designate-common | _write_conf_delegated | remove all but last 10 backups of {{ dest }}"
  shell: ls -td {{ designate_service_conf_dir }}/{{ dest }}.* |awk 'NR>10' |xargs rm -f
  when: item.stat.exists
  delegate_to: "{{ item.item }}"
  with_items: "{{ conf_stat_result.results }}"0707010000008B000081A40000000000000000000000015DCB325C00000620000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/configure.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.
#
# designate-common | configure
---
- debug:
    msg: "Running designate-common configure for {{ designate_component }}"
    when: designate_component is defined
    run_once: true

- include: _write_conf.yml
  src: "designate.conf.j2"
  dest: "designate.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-common | configure | Notify on designate.conf change"
  shell: echo "notify change"
  when: write_conf_result.changed
  register: ardana_notify_designate_restart_required

- name: "designate-common | configure | default rootwrap_changed to false"
  set_fact:
    rootwrap_changed: false

- include: _configure_rootwrap.yml
  when: designate_rootwrap_filters is defined

- name: "designate-common | configure | default policy_changed to false"
  set_fact:
    policy_changed: false

- include: _configure_policy.yml
0707010000008C000081A40000000000000000000000015DCB325C00000BD4000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/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.
#
# common install tasks associated with the install of designate services
---

- name: designate-common | install | debug msg for designate_component
  debug:
    msg: "Running designate-common install for {{ designate_component }}"
  when: designate_component is defined
  run_once: true

# accounts & group
- name: designate-common | install | Add group '{{ designate_system_group }}'
  become: yes
  group: name={{ designate_system_group }}

- name: designate-common | install | Add designate system user account '{{ designate_system_user }}'.
  become: yes
  user:
    name: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    createhome: "{{ designate_system_createhome }}"
    home: "{{ designate_system_home_folder }}"
    shell: "{{ designate_system_shell }}"
    system: True

- name: designate-common | install | Set Permissions {{ designate_system_home_folder }}
  become: yes
  file:
    path: "{{ designate_system_home_folder }}"
    state: directory
    mode: 0750

# directories
- name: designate-common | install | Create directories
  become: yes
  file:
    path: "{{ item.file }}"
    owner: "{{ designate_system_user }}"
    group: "{{ item.group | default('root') }}"
    mode: "{{ item.mode | default('a-rwx,u+rwx,g+rx,o+rx') }}"
    state: directory
  with_items:
    - file: "{{ designate_lock_path }}"
    - file: "{{ designate_log_file_location }}"
      group: "{{ designate_system_group }}"
      mode: "0755"

# Make sure we do not create a path to a symlink that does not exist yet
- name: designate-common | install | Check '{{ designate_service_etc_dir }}' dir exists
  stat:
    path={{ designate_service_etc_dir }}
  register: designate_service_etc_dir_result

- fail: designate-common | install | Fail when '{{ designate_service_etc_dir }}' does not exist
  when: not designate_service_etc_dir_result.stat.exists or not designate_service_etc_dir_result.stat.isdir

- name: designate-common | install | Create directory '{{ designate_service_conf_dir }}'.
  become: yes
  file:
    path={{ designate_service_conf_dir }}
    owner={{ designate_system_user }}
    group={{ designate_system_group }}
    mode=0755
    state=directory

- name: designate-common | install | Install required packages
  become: yes
  package:
    name: "{{ item }}"
    state: present
  with_items:
    designate_required_packages | default([])
0707010000008D000081A40000000000000000000000015DCB325C000002FC000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/tasks/show-vars.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: Display all variables/facts known for '{{ inventory_hostname }}'
  debug:
    var: hostvars[inventory_hostname]
0707010000008E000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/templates0707010000008F000081A40000000000000000000000015DCB325C00000085000000000000000000000000000000000000006300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/templates/designate-rootwrap.j2Defaults:designate !requiretty

designate ALL = (root) NOPASSWD: /usr/local/bin/designate-rootwrap {{ designate_rootwrap_config }} *
07070100000090000081A40000000000000000000000015DCB325C00000845000000000000000000000000000000000000005F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/templates/designate.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.
#
#}
# This configuration file includes the default values for Ardana Openstack
# Changes may be made to this file by the customer.
[DEFAULT]

# General
state_path = {{ designate_state_path }}
root_helper = sudo designate-rootwrap {{ designate_rootwrap_config }}

# Logging
debug = False
log_dir = {{ designate_log_file_location }}

# Quota
quota_zones = 100
quota_zone_recordsets = 500
quota_zone_records = 500
quota_recordset_records = 20
quota_api_export_size = 1000

# End of [DEFAULT] section

[oslo_messaging_rabbit]
rabbit_hosts = {{ rabbit.hosts }}
rabbit_userid = {{ rabbit.rmq_service_user }}
rabbit_password = {{ rabbit.rmq_service_password }}
rabbit_use_ssl = {{ rabbit.rmq_use_ssl }}

# End of [oslo_messaging_rabbit] section

[proxy]
#http_proxy = http://1.2.3.4:8080/
#https_proxy = http://1.2.3.4:8080/
#no_proxy = .mycorp.com, .mycorp.net

# End of [proxy] section

[oslo_policy]
policy_file = {{ designate_policy_file }}

# End of [oslo_policy] section

[oslo_messaging_notifications]
# Ceilometer Notifications
driver = log
driver = messaging
topics = notifications

# End of [oslo_messaging_notifications] section

[oslo_concurrency]
lock_path = {{ designate_lock_path }}

# End of [oslo_concurrency] section

[storage:sqlalchemy]
connection = {{ designate_database_connection }}

# End of [storage:sqlalchemy] section

[ssl]
ca_file = {{ trusted_ca_bundle }}

# End of [ssl] section

### End of File ###
## Do NOT put anything after this line ##
07070100000091000081A40000000000000000000000015DCB325C00000671000000000000000000000000000000000000005E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-common/templates/rootwrap.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.
#
#}
# Configuration for designate-rootwrap
# This file should be owned by (and only-writeable by) the root user

[DEFAULT]
# List of directories to load filter definitions from (separated by ',').
# These directories MUST all be only writeable by root !
filters_path={{ designate_service_conf_dir }}/rootwrap.d,/usr/share/designate/rootwrap

# List of directories to search executables in, in case filters do not
# explicitely specify a full path (separated by ',')
# If not specified, defaults to system PATH environment variable.
# These directories MUST all be only writeable by root !
exec_dirs={{ designate_service_bin_dir }},/sbin,/usr/sbin,/bin,/usr/bin

# Enable logging to syslog
# Default value is False
use_syslog=False

# Which syslog facility to use.
# Valid values include auth, authpriv, syslog, local0, local1...
# Default value is 'syslog'
syslog_log_facility=syslog

# Which messages to log.
# INFO means log all usage
# ERROR means only log unsuccessful attempts
syslog_log_level=ERROR
07070100000092000041ED0000000000000000000000075DCB325C00000000000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns07070100000093000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/defaults07070100000094000081A40000000000000000000000015DCB325C00000525000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/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.
#
# This file will contain the default values for the designate-mdns service
---
designate_component: designate-mdns

# packages listed here will be installed by designate-common | install
designate_required_packages:
  - libmysqlclient18

# packages listed here will trigger a restart of the service when updated
designate_mdns_restart_packages:
  - libmysqlclient18

# mdns.conf
## [service:mdns]
_designate_listens: "{{ host.bind | item('DES_MDN', default=host.bind.DES_MDN_EXT) }}"
designate_mdns_listen: "{{ _designate_listens.internal.ip_address }}:{{ _designate_listens.internal.port }},{{ _designate_listens.public.ip_address }}:{{ _designate_listens.public.port }}"
07070100000095000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/handlers07070100000096000081A40000000000000000000000015DCB325C00000288000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/handlers/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.
#
---
07070100000097000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/meta07070100000098000081A40000000000000000000000015DCB325C000002AC000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/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: designate-common
07070100000099000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/tasks0707010000009A000081A40000000000000000000000015DCB325C000003BA000000000000000000000000000000000000006300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/tasks/check_upgraded_packages.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.
#
---

- name: designate-mdns | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in designate-mdns package dependency - {{ item }}"
  register: ardana_notify_designate_mdns_restart_required
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_mdns_restart_packages
0707010000009B000081A40000000000000000000000015DCB325C000008B9000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/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.
#
# Configure the designate-mdns service
---
- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_mdns_venv_changed }}"

- include: ../../designate-common/tasks/configure.yml

- name: "designate-mdns | configure | Notify on rootwrap change"
  shell: echo "notify rootwrap change"
  register: ardana_notify_designate_mdns_restart_required
  when: rootwrap_changed

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-mdns/templates/mdns.conf.j2"
  dest: "mdns.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-mdns | configure | Notify on mdns.conf change"
  shell: echo "notify change"
  register: ardana_notify_designate_mdns_restart_required
  when: write_conf_result.changed

- name: "designate-mdns | configure | Apply template: {{ item }}"
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - "mdns-logging.conf"
  register: ardana_notify_designate_mdns_restart_required

- name: "designate-mdns | configure | set designate log file ownership"
  become: yes
  file:
    path: "{{ designate_log_file_location }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_log_file_group }}"
    mode: 0640
    state: touch
  with_items:
    - designate-mdns.log
    - designate-mdns-json.log
0707010000009C000081A40000000000000000000000015DCB325C00000835000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/tasks/install.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.
#
# Install designate-mdns service
---

- name: designate-mdns | install | Update installed packager cache
  become: yes
  install_package:
    cache: update

- name: designate-mdns | install | Install the designate-mdns service from the designate venv
  become: yes
  install_package:
    name: designate
    service: designate-mdns
    state: present
    activate: act_off
  register: ardana_notify_designate_mdns_venv_changed

- name: "designate-mdns | install | Notify for restart on venv change"
  shell: echo "notify venv change"
  register: ardana_notify_designate_mdns_restart_required
  when: ardana_notify_designate_mdns_venv_changed.changed

- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_mdns_venv_changed  }}"

- name: designate-mdns | install | Setup designate-mdns service
  become: yes
  setup_systemd:
    service: designate-mdns
    user: "root"
    group: "{{ designate_system_group }}"
    cmd: designate-mdns
    args: >
      --config-file={{ designate_service_conf_dir }}/designate.conf
      --config-file={{ designate_service_conf_dir }}/mdns.conf

- name: designate-mdns | install | Set designate-mdns service to not start on boot
  become: yes
  service:
    name: designate-mdns
    enabled: no

# This must happen after the install_package, or a path which is meant to be a
# symlink will be mkdir'd
- include: ../../designate-common/tasks/install.yml
0707010000009D000081A40000000000000000000000015DCB325C000005D1000000000000000000000000000000000000005100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/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.
#
# Restart or start the designate-mdns service
---

- name: designate-mdns | start | Activate the latest installed version
  become: yes
  install_package:
    name: designate
    service: designate-mdns
    activate: act_on
    version: "{{ ardana_notify_designate_mdns_venv_changed.version }}"
  when: ardana_notify_designate_mdns_venv_changed is defined

- name: designate-mdns | start | Restart designate-mdns service
  become: yes
  service: name=designate-mdns state=restarted
  when: (ardana_notify_designate_mdns_restart_required is defined and ardana_notify_designate_mdns_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: designate-mdns | start | Start designate-mdns service
  become: yes
  service: name=designate-mdns state=started
0707010000009E000081A40000000000000000000000015DCB325C000002C0000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/tasks/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.
#
---

- include: ../../designate-common/tasks/_service_status.yml
0707010000009F000081A40000000000000000000000015DCB325C00000387000000000000000000000000000000000000005000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/tasks/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.
#
# Stop the designate-mdns service
---
- name: designate-mdns | stop | stop designate-mdns service
  become: yes
  service: name=designate-mdns state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
070701000000A0000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/templates070701000000A1000081A40000000000000000000000015DCB325C00000696000000000000000000000000000000000000006000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/templates/mdns-logging.conf.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.
#
#}
[loggers]
keys: root

[handlers]
keys: watchedfile, logstash

[formatters]
keys: context, logstash


[logger_root]
qualname: root
handlers: watchedfile, logstash
level: NOTSET


# Writes to disk
[handler_watchedfile]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-mdns.log',)
formatter: context
level: INFO

# Writes JSON to disk, beaver will ship to logstash
[handler_logstash]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-mdns-json.log',)
formatter: logstash
level: INFO

# datefmt must be set otherwise you end up with too many (msecs) fields
[formatter_context]
class: oslo_log.formatters.ContextFormatter
args: (datefmt=datefmt)
format: %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(tenant)s] %(instance)s%(message)s
datefmt: %Y-%m-%d %H:%M:%S

# the "format" and "datefmt" actually set the "type" and "tags"
[formatter_logstash]
class: logstash.LogstashFormatterVersion1
format: designate
datefmt: designate-mdns
070701000000A2000081A40000000000000000000000015DCB325C00000437000000000000000000000000000000000000005800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-mdns/templates/mdns.conf.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.
#
#}
# This file has the Ardana Openstack values that apply only to the
# Designate MDNS service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
# Logging
log_config_append = "{{ designate_service_conf_dir }}/mdns-logging.conf"

# End of [DEFAULT] section

[service:mdns]
listen = {{ designate_mdns_listen }}

# End of [service:mdns] section

### End of File ###
## Do NOT put anything after this line ##
070701000000A3000041ED0000000000000000000000055DCB325C00000000000000000000000000000000000000000000004400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca070701000000A4000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/defaults070701000000A5000081A40000000000000000000000015DCB325C000002FA000000000000000000000000000000000000005600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/defaults/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.
#
# This file will contain the default values for the designate-monasca component
---
designate_component: designate-monasca
070701000000A6000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/meta070701000000A7000081A40000000000000000000000015DCB325C000002D5000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/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: designate-common
  - {role: monasca-agent, run_mode: Use}
070701000000A8000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/tasks070701000000A9000081A40000000000000000000000015DCB325C000003E8000000000000000000000000000000000000005C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/tasks/local_monitor.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.
#
---

- name: designate-monasca | local_monitor | Setup active check on the Designate API locally
  become: yes
  monasca_agent_plugin:
    name: "httpcheck"
    args: "url=http://{{ host.bind.DES_API.internal.ip_address }}:{{ host.bind.DES_API.internal.port }}/ dimensions=service:dns,component:designate-api,monitored_host_type:instance,api_endpoint:internal"
070701000000AA000081A40000000000000000000000015DCB325C000003B7000000000000000000000000000000000000005D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/tasks/remote_monitor.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.
#
---

- name: designate-monasca | remote_monitor | Setup active check on the Designate API remotely
  become: yes
  monasca_agent_plugin:
    name: "httpcheck"
    args: "url={{ DES_API.advertises.vips.private[0].url }} dimensions=service:dns,component:designate-api,monitored_host_type:vip,api_endpoint:private"
070701000000AB000081A40000000000000000000000015DCB325C00000334000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-monasca/tasks/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.
#
---

- name: designate-monasca | start | Run Monasca agent Designate detection plugin
  become: yes
  monasca_agent_plugin:
    name: "designate"
    args: "disable_http_check=yes"
070701000000AC000041ED0000000000000000000000075DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager070701000000AD000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/defaults070701000000AE000081A40000000000000000000000015DCB325C00000D78000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/defaults/main.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (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.
#
# This file will contain the default values for the designate-pool-manager service
---
designate_component: designate-pool-manager

# packages listed here will be installed by designate-common | install
designate_required_packages:
  - libmysqlclient18

# packages listed here will trigger a restart of the service when updated
designate_pool_manager_restart_packages:
  - libmysqlclient18

# Rootwrap filters to install
designate_rootwrap_filters:
  - rootwrap.d/bind9.filters

# Used exclusivly for powerdns-post-configure's designate-manage calls
designate_pool_manager_etc_dir: "{{ designate_component | config_dir() }}"
designate_pool_manager_conf_dir: "{{ designate_component | config_dir() }}/designate"
designate_pool_manager_bin_dir: "{{ designate_component | bin_dir() }}"

# pool-manager.conf
## [service:pool_manager]
designate_pool_id: 794ccc2c-d751-44fe-b57f-8894c9f5c842

_designate_powerdns_database_ca_file: "{{ trusted_ca_bundle }}"
_designate_powerdns_database_ssl: "{% if ( 'FND_PDN' in verb_hosts ) and FND_PDN.consumes_FND_MDB.vips.private[0].use_tls %}?ssl_ca={{ _designate_powerdns_database_ca_file }}{% endif %}"

## [pool_target:*]
_designate_mdns_servers: "{{ DES_PMG | item('consumes_DES_MDN.members', default=DES_PMG.consumes_DES_MDN_EXT.members) }}"
designate_pool_masters: "{% for mdns in _designate_mdns_servers.private -%}{{ mdns.ip_address }}:{{ mdns.port}}{% if not loop.last %}, {% endif %}{% endfor %}"
designate_powerdns_database_connection: "{% if ( 'FND_PDN' in verb_hosts ) -%}mysql+pymysql://{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.username }}:{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.password | urlencode }}@{{ FND_PDN.consumes_FND_MDB.vips.private[0].host }}/designate_pdns{{ _designate_powerdns_database_ssl }}{%-endif %}"
designate_powerdns_api_key: "{{ FND_PDN | item('vars.pdns_api_key', default='changeme') }}"

## [pool_manager_cache:memcache]
designate_pool_manager_memcached_servers: "{% for mem in DES_PMG.consumes_FND_MEM.members.private %}{{ mem.ip_address }}:{{ mem.port }}{% if not loop.last %},{% endif %}{% endfor -%}"

## [coordination]
designate_backend_url: "zookeeper://{% for node in DES_PMG.consumes_FND_ZOO.members.private %}{{ node.host }}:{{ node.port }}{% if not loop.last %},{% endif %}{% endfor %}"

# Used for Bind RNDC Access - Pool Manager uses rndc to perform updates
designate_rndc_key_file: "{{ designate_pool_manager_conf_dir }}/rndc.key"
designate_rndc_key: "{% if ( 'FND_BND' in verb_hosts ) %}{{ FND_BND.vars.bind_rndc_key | b64encode }}{% endif %}"

# Default pool nameserver records
default_ns_records: "{{ config_data | item('DES.ns_records',
                      default=[{'hostname': 'ns1.example.org.', 'priority': 1},
                      {'hostname': 'ns2.example.org.', 'priority': 2}]) }}"
070701000000AF000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/handlers070701000000B0000081A40000000000000000000000015DCB325C00000288000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/handlers/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.
#
---
070701000000B1000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/meta070701000000B2000081A40000000000000000000000015DCB325C000002B1000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/meta/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.
#
---
dependencies:
  - role: designate-common
070701000000B3000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/tasks070701000000B4000081A40000000000000000000000015DCB325C000003DF000000000000000000000000000000000000006B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/tasks/check_upgraded_packages.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.
#
---

- name: designate-pool-manager | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in designate-pool-manager package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_pool_manager_restart_packages
  register: ardana_notify_designate_pool_manager_restart_required
070701000000B5000081A40000000000000000000000015DCB325C00000C5D000000000000000000000000000000000000005D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
#
# 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.
#
# Configure the designate-pool-manager service
---
- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_pool_manager_venv_changed }}"

- include: ../../designate-common/tasks/configure.yml

- name: "designate-pool-manager | configure | Notify on rootwrap change"
  shell: echo "notify rootwrap change"
  when: rootwrap_changed
  register: ardana_notify_designate_pool_manager_restart_required

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-pool-manager/templates/pool-manager.conf.j2"
  dest: "pool-manager.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-pool-manager | configure | Notify on pool-manager.conf change"
  shell: echo "notify change"
  when: write_conf_result.changed
  register: ardana_notify_designate_pool_manager_restart_required

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-pool-manager/templates/pools.yaml.j2"
  dest: "pools.yaml"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-pool-manager | configure | Notify on pools.yaml change"
  shell: echo "notify change"
  when: write_conf_result.changed
  register: ardana_notify_designate_pool_manager_restart_required

- name: "designate-pool-manager | configure | Apply template: {{ item }}"
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - "pool-manager-logging.conf"
  register: ardana_notify_designate_pool_manager_restart_required

- name: "designate-pool-manager | configure | Write rndc key file"
  become: yes
  template:
    src: "rndc.key.j2"
    dest: "{{ designate_rndc_key_file }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0600
  when: ( 'FND_BND' in verb_hosts )
  register: ardana_notify_designate_pool_manager_restart_required

- name: "designate-pool-manager | configure | set designate log file ownership"
  become: yes
  file:
    path: "{{ designate_log_file_location }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_log_file_group }}"
    mode: 0640
    state: touch
  with_items:
    - designate-pool-manager.log
    - designate-pool-manager-json.log
070701000000B6000081A40000000000000000000000015DCB325C00000ADD000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/tasks/install.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.
#
# Install designate-pool-manager service
---

- name: designate-pool-manager | install | Update installed packager cache
  become: yes
  install_package:
    cache: update

- name: designate-pool-manager | install | Install the designate-pool-manager service from the designate venv
  become: yes
  install_package:
    name: designate
    service: designate-pool-manager
    state: present
    activate: act_off
  register: ardana_notify_designate_pool_manager_venv_changed

- name: "designate-pool-manager | install | Notify for restart on venv change"
  shell: echo "notify venv change"
  register: ardana_notify_designate_pool_manager_restart_required
  when: ardana_notify_designate_pool_manager_venv_changed.changed

- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_pool_manager_venv_changed }}"

- name: designate-pool-manager | install | set service directories
  set_fact:
    designate_pool_manager_etc_dir:
      "{{ designate_component | config_dir(ardana_notify_designate_pool_manager_venv_changed.version) }}"
    designate_pool_manager_conf_dir:
      "{{ designate_component | config_dir(ardana_notify_designate_pool_manager_venv_changed.version) }}/designate"
    designate_pool_manager_bin_dir:
      "{{ designate_component | bin_dir(ardana_notify_designate_pool_manager_venv_changed.version) }}"

- name: designate-pool-manager | install | Setup designate-pool-manager service
  become: yes
  setup_systemd:
    service: designate-pool-manager
    user: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    cmd: designate-pool-manager
    args: >
      --config-file={{ designate_service_conf_dir }}/designate.conf
      --config-file={{ designate_service_conf_dir }}/pool-manager.conf

- name: designate-pool-manager | install | Set designate-pool-manager service to not start on boot
  become: yes
  service:
    name: designate-pool-manager
    enabled: no

# This must happen after the install_package, or a path which is meant to be a
# symlink will be mkdir'd
- include: ../../designate-common/tasks/install.yml
070701000000B7000081A40000000000000000000000015DCB325C00000639000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/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.
#
# Restart or start the designate-pool-manager service
---

- name: designate-pool-manager | start | Activate the latest installed version
  become: yes
  install_package:
    name: designate
    service: designate-pool-manager
    activate: act_on
    version: "{{ ardana_notify_designate_pool_manager_venv_changed.version }}"
  when: ardana_notify_designate_pool_manager_venv_changed is defined

- name: designate-pool-manager | start | Restart designate-pool-manager service
  become: yes
  service: name=designate-pool-manager state=restarted
  when: (ardana_notify_designate_pool_manager_restart_required is defined and ardana_notify_designate_pool_manager_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: designate-pool-manager | start | Start designate-pool-manager service
  become: yes
  service: name=designate-pool-manager state=started
070701000000B8000081A40000000000000000000000015DCB325C000002C5000000000000000000000000000000000000005A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/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: ../../designate-common/tasks/_service_status.yml
070701000000B9000081A40000000000000000000000015DCB325C000003AC000000000000000000000000000000000000005800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/tasks/stop.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.
#
# Stop the designate-pool-manager service
---
- name: designate-pool-manager | stop | stop designate-pool-manager service
  become: yes
  service: name=designate-pool-manager state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
070701000000BA000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates070701000000BB000081A40000000000000000000000015DCB325C00001027000000000000000000000000000000000000006600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates/_backend-macros.j2{#
#
# (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.
#
#}
{%- macro dynect(customer_name="", username="", password="", nameservers=[], also_notifies=[], masters=[]) -%}
### Start DynECT Assisted Configuration
{%- set pool_nameservers=[] %}

[pool_target:00000000-0000-0003-0002-000000000001]
type = dynect
options = customer_name: {{ customer_name }}, username: {{ username }}, password: {{ password }}
masters = {{ masters }}

# End of [pool_target:00000000-0000-0003-0002-000000000001] section

{% for nameserver in nameservers %}
{% set pool_nameserver_uuid %}00000000-0000-0003-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}
[pool_nameserver:{{ pool_nameserver_uuid }}]
port = 53
host = {{ nameserver }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section
{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = 00000000-0000-0003-0002-000000000001
also_notifies = {{ also_notifies | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section

### End DynECT Assisted Configuration
{%- endmacro %}







{%- macro akamai(username="", password="", nameservers=[], also_notifies=[], masters=[]) -%}
### Start Akamai Assisted Configuration
{%- set pool_nameservers=[] %}

[pool_target:00000000-0000-0004-0002-000000000001]
type = akamai
options = username: {{ username }}, password: {{ password }}
masters = {{ masters }}

# End of [pool_target:00000000-0000-0004-0002-000000000001] section

{% for nameserver in nameservers %}
{% set pool_nameserver_uuid %}00000000-0000-0004-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}
[pool_nameserver:{{ pool_nameserver_uuid }}]
port = 53
host = {{ nameserver }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section
{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = 00000000-0000-0004-0002-000000000001
also_notifies = {{ also_notifies | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section

### End Akamai Assisted Configuration
{%- endmacro %}






{%- macro infoblox(wapi_url, username, password, ns_group, nameservers=[], also_notifies=[], masters=[], sslverify=True, multi_tenant=False, http_pool_connections=100, http_pool_maxsize=100, dns_view="default", network_view="default") -%}
### Start InfoBlox Assisted Configuration
{%- set pool_nameservers=[] %}

[pool_target:00000000-0000-0005-0002-000000000001]
type = infoblox
options = wapi_url: "{{ wapi_url }}", username: "{{ username }}", password: "{{ password }}", ns_group: "{{ ns_group }}", sslverify: {{ sslverify }}, http_pool_connections: {{ http_pool_connections }}, http_pool_maxsize: {{ http_pool_maxsize }}, dns_view: "{{ dns_view }}", network_view: "{{ network_view }}"
masters = {{ masters }}

# End of [pool_target:00000000-0000-0005-0002-000000000001] section

{% for nameserver in nameservers %}
{% set pool_nameserver_uuid %}00000000-0000-0005-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}
[pool_nameserver:{{ pool_nameserver_uuid }}]
port = 53
host = {{ nameserver }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section
{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = 00000000-0000-0005-0002-000000000001
also_notifies = {{ also_notifies | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section

### End InfoBlox Assisted Configuration
{%- endmacro %}
070701000000BC000081A40000000000000000000000015DCB325C000007B0000000000000000000000000000000000000006100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates/_bind-pool.j2{#
#
# (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.
#
#}
{% if DES_PMG.consumes_FND_BND.members is defined -%}
{% set pool_nameservers=[] %}
{% set pool_targets=[] %}
{% set bind_members=DES_PMG.consumes_FND_BND.members.private %}
{% set bind_rndc_members=DES_PMG.consumes_FND_BND.members.bind_rndc %}
# Bind Pool Configuration
{% for member in bind_members %}
{% set rndc=bind_rndc_members[loop.index0] %}

{% set pool_nameserver_uuid %}00000000-0000-0002-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}

{% set pool_target_uuid %}00000000-0000-0002-0002-{{ '%012d' % loop.index }}{% endset %}
{% do pool_targets.append(pool_target_uuid) %}

[pool_nameserver:{{ pool_nameserver_uuid }}]
host = {{ member.ip_address }}
port = {{ member.port }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section

[pool_target:{{ pool_target_uuid }}]
type = bind9
masters = {{ designate_pool_masters }}
options = rndc_host: {{ rndc.ip_address }}, rndc_port: {{ rndc.port }}, rndc_key_file: {{ designate_rndc_key_file }}, host: {{ member.ip_address }}, port: {{ member.port }}

# End of [pool_target:{{ pool_target_uuid }}] section

{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = {{ pool_targets | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section
{% endif %}
070701000000BD000081A40000000000000000000000015DCB325C000006D1000000000000000000000000000000000000006500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates/_powerdns-pool.j2{#
#
# (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.
#
#}
{% if DES_PMG.consumes_FND_PDN.members is defined -%}
{% set pool_nameservers=[] %}
{% set pool_targets=[] %}
{% set powerdns_members=DES_PMG.consumes_FND_PDN.members.private %}
# PowerDNS Pool Configuration
{% for member in powerdns_members %}
{% set pool_nameserver_uuid %}00000000-0000-0001-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}

[pool_nameserver:{{ pool_nameserver_uuid }}]
host = {{ member.ip_address }}
port = {{ member.port }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section

{% endfor %}
{% do pool_targets.append("00000000-0000-0001-0002-000000000001") %}
[pool_target:00000000-0000-0001-0002-000000000001]
type = powerdns
masters = {{ designate_pool_masters }}
options = connection: {{ designate_powerdns_database_connection }}, host: 127.0.0.1, port: 53

# End of [pool_target:00000000-0000-0001-0002-000000000001] section

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = {{ pool_targets | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section
{% endif %}
070701000000BE000081A40000000000000000000000015DCB325C000006B3000000000000000000000000000000000000007000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates/pool-manager-logging.conf.j2{#
#
# (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.
#
#}
[loggers]
keys: root

[handlers]
keys: watchedfile, logstash

[formatters]
keys: context, logstash


[logger_root]
qualname: root
handlers: watchedfile, logstash
level: NOTSET


# Writes to disk
[handler_watchedfile]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-pool-manager.log',)
formatter: context
level: INFO

# Writes JSON to disk, beaver will ship to logstash
[handler_logstash]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-pool-manager-json.log',)
formatter: logstash
level: INFO

# datefmt must be set otherwise you end up with too many (msecs) fields
[formatter_context]
class: oslo_log.formatters.ContextFormatter
args: (datefmt=datefmt)
format: %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(tenant)s] %(instance)s%(message)s
datefmt: %Y-%m-%d %H:%M:%S

# the "format" and "datefmt" actually set the "type" and "tags"
[formatter_logstash]
class: logstash.LogstashFormatterVersion1
format: designate
datefmt: designate-pool-manager
070701000000BF000081A40000000000000000000000015DCB325C00000553000000000000000000000000000000000000006800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates/pool-manager.conf.j2{#
#
# (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.
#
#}
# This file has the Ardana values that apply only to the Designate Pool
# Manager service. You may make changes to this file by adding
# sections/options below.
[DEFAULT]
# Logging
log_config_append = "{{ designate_service_conf_dir }}/pool-manager-logging.conf"

# End of [DEFAULT] section

[service:pool_manager]
pool_id = {{ designate_pool_id }}
cache_driver = memcache

# End of [service:pool_manager] section

[pool_manager_cache:memcache]
memcached_servers = {{ designate_pool_manager_memcached_servers }}

# End of [pool_manager_cache:memcache] section

[coordination]
backend_url = {{ designate_backend_url }}

# End of [coordination] section

### End of File ###
## Do NOT put anything after this line ##
070701000000C0000081A40000000000000000000000015DCB325C00001487000000000000000000000000000000000000006100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates/pools.yaml.j2{#
#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (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: default
  description: Default Pool

  ns_records:
{% for ns_rec in default_ns_records %}
    - hostname: {{ ns_rec.hostname }}
      priority: {{ ns_rec.priority }}
{% endfor %}

  nameservers:
{% if DES_PMG.consumes_FND_PDN is defined %}
{% for pdn_member in DES_PMG.consumes_FND_PDN.members.private %}
    - host: {{ pdn_member.ip_address }}
      port: {{ pdn_member.port }}
{% endfor %}
{% endif %}
{% if DES_PMG.consumes_FND_BND is defined %}
{% for bnd_member in DES_PMG.consumes_FND_BND.members.private %}
    - host: {{ bnd_member.ip_address }}
      port: {{ bnd_member.port }}
{% endfor %}
{% endif %}
#  also_notifies:
  targets:
{% if DES_PMG.consumes_FND_PDN is defined %}
    - type: pdns4
      description: PowerDNS4 Cluster

      masters:
{% if DES_PMG.consumes_DES_MDN is defined %}
{% for mdn_member in DES_PMG.consumes_DES_MDN.members.private %}
        - host: {{ mdn_member.ip_address }}
          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}

      options:
        host: {{ DES_PMG.consumes_FND_PDN.members.private[0].ip_address }}
        port: 53
        connection: {{ designate_powerdns_database_connection }}
        api_endpoint: "http://{{ DES_PMG.consumes_FND_PDN.members.private[0].ip_address }}:8081"
        api_token: {{ designate_powerdns_api_key }}
{% endif %}


{% if DES_PMG.consumes_FND_BND is defined %}
{% for priv_member in DES_PMG.consumes_FND_BND.members.private %}
{% for rndc_member in DES_PMG.consumes_FND_BND.members.bind_rndc %}
{% if priv_member.ip_address == rndc_member.ip_address %}

    - type: bind9
      description: BIND9 Server {{ priv_member.ip_address }}

      masters:
{% if DES_PMG.consumes_DES_MDN is defined %}
{% for mdn_member in DES_PMG.consumes_DES_MDN.members.private %}
        - host: {{ mdn_member.ip_address }}
          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}

      # BIND Configuration options
      options:
        host: {{ priv_member.ip_address }}
        port: {{ priv_member.port }}
        rndc_host: {{ rndc_member.ip_address }}
        rndc_port: {{ rndc_member.port }}
        rndc_key_file: /etc/bind/rndc.key
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}

#
#    - type: infoblox
#      description: infoblox Cluster
#
#      masters:
{% if DES_PMG.consumes_DES_MDN_EXT is defined %}
{% for mdn_member in DES_PMG.consumes_DES_MDN_EXT.members.private %}
#        - host: {{ mdn_member.ip_address }}
#          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}
#
#      options:
#        wapi_url: https://127.0.0.1/wapi/v2.2.2/
#        username: admin
#        password: infoblox
#        ns_group: designate
#        sslverify: False
#        dns_view: default
#        network_view: default
#
#
#    - type: dynect
#      description: DynECT API
#
#      options:
#        customer_name: dynect_customer
#        username: dynect_username
#        password: dynect_password
#
#      masters:
{% if DES_PMG.consumes_DES_MDN_EXT is defined %}
{% for mdn_member in DES_PMG.consumes_DES_MDN_EXT.members.private %}
#        - host: {{ mdn_member.ip_address }}
#          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}
#
#  also_notifies:
   # This is the list of DynECT's xfr-in server IP addresses,
   # a up to date list can be obtained from your Dyn account manager.
#    - host: 204.13.249.65
#      port: 53
#    - host: 208.78.68.65
#      port: 53
#
#
#    - type: akamai
#      description: Akamai Server
#
#      options:
#        username: akamai_username
#        password: akamai_password
#
#      masters:
{% if DES_PMG.consumes_DES_MDN_EXT is defined %}
{% for mdn_member in DES_PMG.consumes_DES_MDN_EXT.members.private %}
#        - host: {{ mdn_member.ip_address }}
#          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}
#
#  also_notifies:
   # This is the list of Akamai's zone transfer agent (ZTA) server IP
   # addresses, a up to date list can be obtained from your Akamai
   # account manager.
#    - host: 193.108.155.34
#      port: 53
#    - host: 23.73.134.141
#      port: 53
#    - host: 80.67.64.148
#      port: 53
#    - host: 23.73.134.237
#      port: 53
#    - host: 23.73.133.141
#      port: 53
#    - host: 23.73.133.237
#      port: 53
#    - host: 80.67.64.10
#      port: 53
#    - host: 72.246.0.10
#      port: 53
#    - host: 72.247.45.157
#      port: 53
#    - host: 72.246.192.168
#      port: 53
#    - host: 193.108.152.143
#      port: 53
#    - host: 60.254.128.45
#      port: 53
#    - host: 72.247.45.110
#      port: 53
#    - host: 72.247.45.65
#      port: 53
#    - host: 72.247.45.25
#      port: 53
070701000000C1000081A40000000000000000000000015DCB325C000003CE000000000000000000000000000000000000005F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-pool-manager/templates/rndc.key.j2{#
#
# (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.
#
#}
// This file has been generated by ansible from
// designate-pool-manager/templates/rndc.key.j2
// It contains the Ardana values that apply only to the bind
// service. You may make changes to this file by adding
// sections/options below.

key "rndc-key" {
    algorithm hmac-md5;
    secret "{{ designate_rndc_key }}";
};
070701000000C2000041ED0000000000000000000000055DCB325C00000000000000000000000000000000000000000000004B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure070701000000C3000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/defaults070701000000C4000081A40000000000000000000000015DCB325C00000633000000000000000000000000000000000000005D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/defaults/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.
#
---

keystone:
  endpoint: "{{ DES_CEN.consumes_KEY_API.vips.private[0].url }}/v3"
  designate_admin_user: "{{ DES_CEN.consumes_KEY_API.vars.keystone_designate_user }}"
  designate_admin_password: "{{ DES_CEN.consumes_KEY_API.vars.keystone_designate_password | quote }}"
  role: "{{ KEY_API.vars.keystone_admin_role }}"
  service_tenant: "{{ KEY_API.vars.keystone_service_tenant }}"
  admin_user: "{{ KEY_API.vars.keystone_admin_user }}"
  admin_password: "{{ KEY_API.vars.keystone_admin_pwd | quote }}"
  default_domain_name: "{{ KEY_API.vars.keystone_default_domain }}"
mysql:
  host: "{{ DES_CEN.consumes_FND_MDB.vips.private[0].host }}"
  login_password: "{{ FND_MDB.vars.mysql_service_pwd | quote }}"
  login_user: "{{ FND_MDB.vars.mysql_service_user }}"
  designate_admin_password: "{{ DES_CEN.consumes_FND_MDB.vars.accounts.designate.password | quote }}"
  designate_admin_user: "{{ DES_CEN.consumes_FND_MDB.vars.accounts.designate.user }}"
070701000000C5000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/meta070701000000C6000081A40000000000000000000000015DCB325C000002C8000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/meta/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.
#
---
dependencies:
  - role: designate-common
  - role: designate-central
070701000000C7000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/tasks070701000000C8000081A40000000000000000000000015DCB325C00000426000000000000000000000000000000000000006200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/tasks/db_configure.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.
#
# Designate Database
---
- name: designate-post-configure | db_configure | Run designate-manage database sync
  become: yes
  become_user: "{{ designate_system_user }}"
  command: >
    {{ designate_central_bin_dir }}/designate-manage
    --config-file {{ designate_central_conf_dir }}/designate.conf
    --config-file {{ designate_central_conf_dir }}/central.conf
    database sync
  run_once_per: verb_hosts.DES_CEN
070701000000C9000081A40000000000000000000000015DCB325C00000283000000000000000000000000000000000000006100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/tasks/db_contract.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.
#
---
070701000000CA000081A40000000000000000000000015DCB325C0000031D000000000000000000000000000000000000005F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/tasks/db_expand.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.
#
---
# For now we call configure from here. We may do more in the future.
- name: designate-post-configure | db_expand | DB Expand
  include: db_configure.yml
070701000000CB000081A40000000000000000000000015DCB325C00000606000000000000000000000000000000000000006E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/tasks/keystone_change_password.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.
#
# Designate keystone password change
---

- name: designate-post-configure | keystone_change_password | Get a domain scoped token
  keystone_v3:
    endpoint: "{{ keystone.endpoint }}"
    login_username: "{{ keystone.admin_user }}"
    login_password: "{{ keystone.admin_password }}"
    login_user_domain_name: "{{ keystone.default_domain_name }}"
    login_domain_name: "{{ keystone.default_domain_name }}"
    action: "token_get"
  run_once: true
  register: domain_scoped_token_result

- name: designate-post-configure | keystone_change_password | Change designate Keystone password
  keystone_v3:
    action: "reset_password_by_admin"
    endpoint: "{{ keystone.endpoint }}"
    login_token: "{{ domain_scoped_token_result.result }}"
    user_name: "{{ keystone.designate_admin_user }}"
    user_password: "{{ keystone.designate_admin_password }}"
    user_domain_name: "Default"
  run_once: true
070701000000CC000081A40000000000000000000000015DCB325C000008E2000000000000000000000000000000000000006300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-post-configure/tasks/keystone_conf.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.
#
# Designate keystone configuration
---

- name: designate-post-configure | keystone_conf | Get a domain scoped token
  keystone_v3:
    endpoint: "{{ keystone.endpoint }}"
    login_username: "{{ keystone.admin_user }}"
    login_password: "{{ keystone.admin_password }}"
    login_user_domain_name: "{{ keystone.default_domain_name }}"
    login_domain_name: "{{ keystone.default_domain_name }}"
    action: "token_get"
  run_once: true
  register: domain_scoped_token_result

- name: designate-post-configure | keystone_conf | Create Designate Keystone User
  keystone_v3:
    action: "create_user"
    endpoint: "{{ keystone.endpoint }}"
    login_token: "{{ domain_scoped_token_result.result }}"
    user_name: "{{ keystone.designate_admin_user }}"
    user_password: "{{ keystone.designate_admin_password }}"
    user_domain_name: "Default"
  run_once: true

- name: designate-post-configure | keystone_conf | Add role to Designate User
  keystone_v3:
    action: "grant_project_role"
    endpoint: "{{ keystone.endpoint }}"
    login_token: "{{ domain_scoped_token_result.result }}"
    project_name: "{{ keystone.service_tenant }}"
    user_name: "{{ keystone.designate_admin_user }}"
    role_name: "{{ keystone.role }}"
    user_domain_name: "Default"
    project_domain_name: "Default"
  run_once: true

- name: designate-post-configure | keystone_conf | Create Designate Admin role in Keystone
  keystone_v3:
    action: "create_role"
    endpoint: "{{ keystone.endpoint }}"
    login_token: "{{ domain_scoped_token_result.result }}"
    role_name: "designate_admin"
    description: "Designate admin role"
  run_once: true
070701000000CD000041ED0000000000000000000000065DCB325C00000000000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer070701000000CE000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/defaults070701000000CF000081A40000000000000000000000015DCB325C0000051B000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/defaults/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.
#
# This file will contain the default values for the designate-producer service
---
designate_component: designate-producer

# packages listed here will be installed by designate-common | install
designate_required_packages:
  - libmysqlclient18

# packages listed here will trigger a restart of the service when updated
designate_producer_restart_packages:
  - libmysqlclient18

# producer.conf
## [service:producer]

## [coordination]
designate_backend_url: "zookeeper://{% for node in DES_PDR.consumes_FND_ZOO.members.private %}{{ node.host }}:{{ node.port }}{% if not loop.last %},{% endif %}{% endfor %}"

#designate_pool_id:  794ccc2c-d751-44fe-b57f-8894c9f5c842
070701000000D0000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/meta070701000000D1000081A40000000000000000000000015DCB325C000002AC000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/meta/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.
#
---
dependencies:
  - role: designate-common
070701000000D2000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/tasks070701000000D3000081A40000000000000000000000015DCB325C000003CA000000000000000000000000000000000000006700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/tasks/check_upgraded_packages.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: designate-producer | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in designate-producer package dependency - {{ item }}"
  register: ardana_notify_designate_producer_restart_required
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_producer_restart_packages
070701000000D4000081A40000000000000000000000015DCB325C000008F4000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/tasks/configure.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.
#
# Configure the designate-producer service
---
- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_producer_venv_changed }}"

- include: ../../designate-common/tasks/configure.yml

- name: "designate-producer | configure | Notify on rootwrap change"
  shell: echo "notify rootwrap change"
  register: ardana_notify_designate_producer_restart_required
  when: rootwrap_changed

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-producer/templates/producer.conf.j2"
  dest: "producer.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-producer | configure | Notify on producer.conf change"
  shell: echo "notify change"
  register: ardana_notify_designate_producer_restart_required
  when: write_conf_result.changed

- name: "designate-producer | configure | Apply template: {{ item }}"
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - "producer-logging.conf"
  register: ardana_notify_designate_producer_restart_required

- name: "designate-producer | configure | set designate log file ownership"
  become: yes
  file:
    path: "{{ designate_log_file_location }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_log_file_group }}"
    mode: 0640
    state: touch
  with_items:
    - designate-producer.log
    - designate-producer-json.log
070701000000D5000081A40000000000000000000000015DCB325C0000088E000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/tasks/install.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.
#
# Install designate-producer service
---

- name: designate-producer | install | Update installed packager cache
  become: yes
  install_package:
    cache: update

- name: designate-producer | install | Install the designate-producer service from the designate venv
  become: yes
  install_package:
    name: designate
    service: designate-producer
    state: present
    activate: act_off
  register: ardana_notify_designate_producer_venv_changed

- name: "designate-producer | install | Notify for restart on venv change"
  shell: echo "notify venv change"
  register: ardana_notify_designate_producer_restart_required
  when: ardana_notify_designate_producer_venv_changed.changed

- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_producer_venv_changed }}"

- name: designate-producer | install | Setup designate-producer service
  become: yes
  setup_systemd:
    service: designate-producer
    user: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    cmd: designate-producer
    args: >
      --config-file={{ designate_service_conf_dir }}/designate.conf
      --config-file={{ designate_service_conf_dir }}/producer.conf

- name: designate-producer | install | Set designate-producer service to not start on boot
  become: yes
  service:
    name: designate-producer
    enabled: no

# This must happen after the install_package, or a path which is meant to be a
# symlink will be mkdir'd
- include: ../../designate-common/tasks/install.yml
070701000000D6000081A40000000000000000000000015DCB325C00000600000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/tasks/start.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.
#
# Restart or start the designate-producer service
---

- name: designate-producer | start | Activate the latest installed version
  become: yes
  install_package:
    name: designate
    service: designate-producer
    activate: act_on
    version: "{{ ardana_notify_designate_producer_venv_changed.version }}"
  when: ardana_notify_designate_producer_venv_changed is defined

- name: designate-producer | start | Restart designate-producer service
  become: yes
  service: name=designate-producer state=restarted
  when: (ardana_notify_designate_producer_restart_required is defined and ardana_notify_designate_producer_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: designate-producer | start | Start designate-producer service
  become: yes
  service: name=designate-producer state=started
070701000000D7000081A40000000000000000000000015DCB325C000002BE000000000000000000000000000000000000005600000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/tasks/status.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.
#
---

- include: ../../designate-common/tasks/_service_status.yml
070701000000D8000081A40000000000000000000000015DCB325C00000397000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/tasks/stop.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.
#
# Stop the designate-producer service
---
- name: designate-producer | stop | stop designate-producer service
  become: yes
  service: name=designate-producer state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
070701000000D9000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/templates070701000000DA000081A40000000000000000000000015DCB325C000006A2000000000000000000000000000000000000006800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/templates/producer-logging.conf.j2{#
#
# (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.
#
#}
[loggers]
keys: root

[handlers]
keys: watchedfile, logstash

[formatters]
keys: context, logstash


[logger_root]
qualname: root
handlers: watchedfile, logstash
level: NOTSET


# Writes to disk
[handler_watchedfile]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-producer.log',)
formatter: context
level: INFO

# Writes JSON to disk, beaver will ship to logstash
[handler_logstash]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-producer-json.log',)
formatter: logstash
level: INFO

# datefmt must be set otherwise you end up with too many (msecs) fields
[formatter_context]
class: oslo_log.formatters.ContextFormatter
args: (datefmt=datefmt)
format: %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(tenant)s] %(instance)s%(message)s
datefmt: %Y-%m-%d %H:%M:%S

# the "format" and "datefmt" actually set the "type" and "tags"
[formatter_logstash]
class: logstash.LogstashFormatterVersion1
format: designate
datefmt: designate-producer
070701000000DB000081A40000000000000000000000015DCB325C00000466000000000000000000000000000000000000006000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-producer/templates/producer.conf.j2{#
#
# (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.
#
#}
# This file has the Ardana openstack values that apply only to the Designate producer
# service. You may make changes to this file by adding
# sections/options below.

[DEFAULT]
# Logging
log_config_append = "{{ designate_service_conf_dir }}/producer-logging.conf"

# End of [DEFAULT] section

[coordination]
backend_url = {{ designate_backend_url }}

[service:worker]
enabled = True

# End of [coordination] section

### End of File ###

## Do NOT put anything after this line ##
070701000000DC000041ED0000000000000000000000065DCB325C00000000000000000000000000000000000000000000004300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker070701000000DD000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/defaults070701000000DE000081A40000000000000000000000015DCB325C00000CDA000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/defaults/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.
#
# This file will contain the default values for the designate-worker service
---
designate_component: designate-worker

# packages listed here will be installed by designate-common | install
designate_required_packages:
  - libmysqlclient18

# packages listed here will trigger a restart of the service when updated
designate_worker_restart_packages:
  - libmysqlclient18

# Rootwrap filters to install
designate_rootwrap_filters:
  - rootwrap.d/bind9.filters

# Used exclusivly for powerdns-post-configure's designate-manage calls
designate_worker_etc_dir: "{{ designate_component | config_dir() }}"
designate_worker_conf_dir: "{{ designate_component | config_dir() }}/designate"
designate_worker_bin_dir: "{{ designate_component | bin_dir() }}"

# worker.conf
## [service:worker]
designate_pool_id: 794ccc2c-d751-44fe-b57f-8894c9f5c842

_designate_powerdns_database_ca_file: "{{ trusted_ca_bundle }}"
_designate_powerdns_database_ssl: "{% if ( 'FND_PDN' in verb_hosts ) and FND_PDN.consumes_FND_MDB.vips.private[0].use_tls %}?ssl_ca={{ _designate_powerdns_database_ca_file }}{% endif %}"

## [pool_target:*]
_designate_mdns_servers: "{{ DES_WKR | item('consumes_DES_MDN.members', default=DES_WKR.consumes_DES_MDN_EXT.members) }}"
designate_pool_masters: "{% for mdns in _designate_mdns_servers.private -%}{{ mdns.ip_address }}:{{ mdns.port}}{% if not loop.last %}, {% endif %}{% endfor %}"
designate_powerdns_database_connection: "{% if ( 'FND_PDN' in verb_hosts ) -%}mysql+pymysql://{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.username }}:{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.password | urlencode }}@{{ FND_PDN.consumes_FND_MDB.vips.private[0].host }}/designate_pdns{{ _designate_powerdns_database_ssl }}{%-endif %}"

## [worker_cache:memcache]
designate_worker_memcached_servers: "{% for mem in DES_WKR.consumes_FND_MEM.members.private %}{{ mem.ip_address }}:{{ mem.port }}{% if not loop.last %},{% endif %}{% endfor -%}"

## [coordination]
designate_backend_url: "zookeeper://{% for node in DES_WKR.consumes_FND_ZOO.members.private %}{{ node.host }}:{{ node.port }}{% if not loop.last %},{% endif %}{% endfor %}"

# Used for Bind RNDC Access - Pool Manager uses rndc to perform updates
designate_rndc_key_file: "{{ designate_worker_conf_dir }}/rndc.key"
designate_rndc_key: "{% if ( 'FND_BND' in verb_hosts ) %}{{ FND_BND.vars.bind_rndc_key | b64encode }}{% endif %}"

# Default pool nameserver records
default_ns_records: "{{ config_data | item('DES.ns_records',
                      default=[{'hostname': 'ns1.example.org.', 'priority': 1},
                      {'hostname': 'ns2.example.org.', 'priority': 2}]) }}"
070701000000DF000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/meta070701000000E0000081A40000000000000000000000015DCB325C000002AC000000000000000000000000000000000000005100000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/meta/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.
#
---
dependencies:
  - role: designate-common
070701000000E1000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/tasks070701000000E2000081A40000000000000000000000015DCB325C000003C2000000000000000000000000000000000000006500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/tasks/check_upgraded_packages.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: designate-worker | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in designate-worker package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_worker_restart_packages
  register: ardana_notify_designate_worker_restart_required
070701000000E3000081A40000000000000000000000015DCB325C00000BF8000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/tasks/configure.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.
#
# Configure the designate-worker service
---
- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_worker_venv_changed }}"

- include: ../../designate-common/tasks/configure.yml

- name: "designate-worker | configure | Notify on rootwrap change"
  shell: echo "notify rootwrap change"
  when: rootwrap_changed
  register: ardana_notify_designate_worker_restart_required

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-worker/templates/worker.conf.j2"
  dest: "worker.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-worker | configure | Notify on worker.conf change"
  shell: echo "notify change"
  when: write_conf_result.changed
  register: ardana_notify_designate_worker_restart_required

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-worker/templates/pools.yaml.j2"
  dest: "pools.yaml"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-worker | configure | Notify on pools.yaml change"
  shell: echo "notify change"
  when: write_conf_result.changed
  register: ardana_notify_designate_worker_restart_required

- name: "designate-worker | configure | Apply template: {{ item }}"
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - "worker-logging.conf"
  register: ardana_notify_designate_worker_restart_required

- name: "designate-worker | configure | Write rndc key file"
  become: yes
  template:
    src: "rndc.key.j2"
    dest: "{{ designate_rndc_key_file }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0600
  when: ( 'FND_BND' in verb_hosts )
  register: ardana_notify_designate_worker_restart_required

- name: "designate-worker | configure | set designate log file ownership"
  become: yes
  file:
    path: "{{ designate_log_file_location }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_log_file_group }}"
    mode: 0640
    state: touch
  with_items:
    - designate-worker.log
    - designate-worker-json.log
070701000000E4000081A40000000000000000000000015DCB325C00000A42000000000000000000000000000000000000005500000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/tasks/install.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.
#
# Install designate-worker service
---

- name: designate-worker | install | Update installed packager cache
  become: yes
  install_package:
    cache: update

- name: designate-worker | install | Install the designate-worker service from the designate venv
  become: yes
  install_package:
    name: designate
    service: designate-worker
    state: present
    activate: act_off
  register: ardana_notify_designate_worker_venv_changed

- name: "designate-worker | install | Notify for restart on venv change"
  shell: echo "notify venv change"
  register: ardana_notify_designate_worker_restart_required
  when: ardana_notify_designate_worker_venv_changed.changed

- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_worker_venv_changed }}"

- name: designate-worker | install | set service directories
  set_fact:
    designate_worker_etc_dir:
      "{{ designate_component | config_dir(ardana_notify_designate_worker_venv_changed.version) }}"
    designate_worker_conf_dir:
      "{{ designate_component | config_dir(ardana_notify_designate_worker_venv_changed.version) }}/designate"
    designate_worker_bin_dir:
      "{{ designate_component | bin_dir(ardana_notify_designate_worker_venv_changed.version) }}"

- name: designate-worker | install | Setup designate-worker service
  become: yes
  setup_systemd:
    service: designate-worker
    user: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    cmd: designate-worker
    args: >
      --config-file={{ designate_service_conf_dir }}/designate.conf
      --config-file={{ designate_service_conf_dir }}/worker.conf

- name: designate-worker | install | Set designate-worker service to not start on boot
  become: yes
  service:
    name: designate-worker
    enabled: no

# This must happen after the install_package, or a path which is meant to be a
# symlink will be mkdir'd
- include: ../../designate-common/tasks/install.yml
070701000000E5000081A40000000000000000000000015DCB325C000005E6000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/tasks/start.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.
#
# Restart or start the designate-worker service
---

- name: designate-worker | start | Activate the latest installed version
  become: yes
  install_package:
    name: designate
    service: designate-worker
    activate: act_on
    version: "{{ ardana_notify_designate_worker_venv_changed.version }}"
  when: ardana_notify_designate_worker_venv_changed is defined

- name: designate-worker | start | Restart designate-worker service
  become: yes
  service: name=designate-worker state=restarted
  when: (ardana_notify_designate_worker_restart_required is defined and ardana_notify_designate_worker_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: designate-worker | start | Start designate-worker service
  become: yes
  service: name=designate-worker state=started
070701000000E6000081A40000000000000000000000015DCB325C000002C0000000000000000000000000000000000000005400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/tasks/status.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.
#
---

- include: ../../designate-common/tasks/_service_status.yml
070701000000E7000081A40000000000000000000000015DCB325C0000038F000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/tasks/stop.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.
#
# Stop the designate-worker service
---
- name: designate-worker | stop | stop designate-worker service
  become: yes
  service: name=designate-worker state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
070701000000E8000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates070701000000E9000081A40000000000000000000000015DCB325C00001022000000000000000000000000000000000000006000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates/_backend-macros.j2{#
#
# (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.
#
#}
{%- macro dynect(customer_name="", username="", password="", nameservers=[], also_notifies=[], masters=[]) -%}
### Start DynECT Assisted Configuration
{%- set pool_nameservers=[] %}

[pool_target:00000000-0000-0003-0002-000000000001]
type = dynect
options = customer_name: {{ customer_name }}, username: {{ username }}, password: {{ password }}
masters = {{ masters }}

# End of [pool_target:00000000-0000-0003-0002-000000000001] section

{% for nameserver in nameservers %}
{% set pool_nameserver_uuid %}00000000-0000-0003-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}
[pool_nameserver:{{ pool_nameserver_uuid }}]
port = 53
host = {{ nameserver }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section
{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = 00000000-0000-0003-0002-000000000001
also_notifies = {{ also_notifies | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section

### End DynECT Assisted Configuration
{%- endmacro %}







{%- macro akamai(username="", password="", nameservers=[], also_notifies=[], masters=[]) -%}
### Start Akamai Assisted Configuration
{%- set pool_nameservers=[] %}

[pool_target:00000000-0000-0004-0002-000000000001]
type = akamai
options = username: {{ username }}, password: {{ password }}
masters = {{ masters }}

# End of [pool_target:00000000-0000-0004-0002-000000000001] section

{% for nameserver in nameservers %}
{% set pool_nameserver_uuid %}00000000-0000-0004-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}
[pool_nameserver:{{ pool_nameserver_uuid }}]
port = 53
host = {{ nameserver }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section
{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = 00000000-0000-0004-0002-000000000001
also_notifies = {{ also_notifies | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section

### End Akamai Assisted Configuration
{%- endmacro %}






{%- macro infoblox(wapi_url, username, password, ns_group, nameservers=[], also_notifies=[], masters=[], sslverify=True, multi_tenant=False, http_pool_connections=100, http_pool_maxsize=100, dns_view="default", network_view="default") -%}
### Start InfoBlox Assisted Configuration
{%- set pool_nameservers=[] %}

[pool_target:00000000-0000-0005-0002-000000000001]
type = infoblox
options = wapi_url: "{{ wapi_url }}", username: "{{ username }}", password: "{{ password }}", ns_group: "{{ ns_group }}", sslverify: {{ sslverify }}, http_pool_connections: {{ http_pool_connections }}, http_pool_maxsize: {{ http_pool_maxsize }}, dns_view: "{{ dns_view }}", network_view: "{{ network_view }}"
masters = {{ masters }}

# End of [pool_target:00000000-0000-0005-0002-000000000001] section

{% for nameserver in nameservers %}
{% set pool_nameserver_uuid %}00000000-0000-0005-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}
[pool_nameserver:{{ pool_nameserver_uuid }}]
port = 53
host = {{ nameserver }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section
{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = 00000000-0000-0005-0002-000000000001
also_notifies = {{ also_notifies | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section

### End InfoBlox Assisted Configuration
{%- endmacro %}
070701000000EA000081A40000000000000000000000015DCB325C000007AB000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates/_bind-pool.j2{#
#
# (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.
#
#}
{% if DES_WKR.consumes_FND_BND.members is defined -%}
{% set pool_nameservers=[] %}
{% set pool_targets=[] %}
{% set bind_members=DES_WKR.consumes_FND_BND.members.private %}
{% set bind_rndc_members=DES_WKR.consumes_FND_BND.members.bind_rndc %}
# Bind Pool Configuration
{% for member in bind_members %}
{% set rndc=bind_rndc_members[loop.index0] %}

{% set pool_nameserver_uuid %}00000000-0000-0002-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}

{% set pool_target_uuid %}00000000-0000-0002-0002-{{ '%012d' % loop.index }}{% endset %}
{% do pool_targets.append(pool_target_uuid) %}

[pool_nameserver:{{ pool_nameserver_uuid }}]
host = {{ member.ip_address }}
port = {{ member.port }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section

[pool_target:{{ pool_target_uuid }}]
type = bind9
masters = {{ designate_pool_masters }}
options = rndc_host: {{ rndc.ip_address }}, rndc_port: {{ rndc.port }}, rndc_key_file: {{ designate_rndc_key_file }}, host: {{ member.ip_address }}, port: {{ member.port }}

# End of [pool_target:{{ pool_target_uuid }}] section

{% endfor %}

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = {{ pool_targets | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section
{% endif %}
070701000000EB000081A40000000000000000000000015DCB325C000006CC000000000000000000000000000000000000005F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates/_powerdns-pool.j2{#
#
# (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.
#
#}
{% if DES_WKR.consumes_FND_PDN.members is defined -%}
{% set pool_nameservers=[] %}
{% set pool_targets=[] %}
{% set powerdns_members=DES_WKR.consumes_FND_PDN.members.private %}
# PowerDNS Pool Configuration
{% for member in powerdns_members %}
{% set pool_nameserver_uuid %}00000000-0000-0001-0001-{{ '%012d' % loop.index }}{% endset %}
{% do pool_nameservers.append(pool_nameserver_uuid) %}

[pool_nameserver:{{ pool_nameserver_uuid }}]
host = {{ member.ip_address }}
port = {{ member.port }}

# End of [pool_nameserver:{{ pool_nameserver_uuid }}] section

{% endfor %}
{% do pool_targets.append("00000000-0000-0001-0002-000000000001") %}
[pool_target:00000000-0000-0001-0002-000000000001]
type = powerdns
masters = {{ designate_pool_masters }}
options = connection: {{ designate_powerdns_database_connection }}, host: 127.0.0.1, port: 53

# End of [pool_target:00000000-0000-0001-0002-000000000001] section

[pool:{{ designate_pool_id }}]
nameservers = {{ pool_nameservers | join(', ') }}
targets = {{ pool_targets | join(', ') }}

# End of [pool:{{ designate_pool_id }}] section
{% endif %}
070701000000EC000081A40000000000000000000000015DCB325C000013EF000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates/pools.yaml.j2{#
#
# (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: default
  description: Default Pool

  ns_records:
{% for ns_rec in default_ns_records %}
    - hostname: {{ ns_rec.hostname }}
      priority: {{ ns_rec.priority }}
{% endfor %}

  nameservers:
{% if DES_WKR.consumes_FND_PDN is defined %}
{% for pdn_member in DES_WKR.consumes_FND_PDN.members.private %}
    - host: {{ pdn_member.ip_address }}
      port: {{ pdn_member.port }}
{% endfor %}
{% endif %}
{% if DES_WKR.consumes_FND_BND is defined %}
{% for bnd_member in DES_WKR.consumes_FND_BND.members.private %}
    - host: {{ bnd_member.ip_address }}
      port: {{ bnd_member.port }}
{% endfor %}
{% endif %}
#  also_notifies:
  targets:
{% if DES_WKR.consumes_FND_PDN is defined %}
    - type: powerdns
      description: PowerDNS Cluster

      masters:
{% if DES_WKR.consumes_DES_MDN is defined %}
{% for mdn_member in DES_WKR.consumes_DES_MDN.members.private %}
        - host: {{ mdn_member.ip_address }}
          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}

      options:
        host: {{ DES_WKR.consumes_FND_PDN.members.private[0].ip_address }}
        port: 53
        connection: {{ designate_powerdns_database_connection }}
{% endif %}


{% if DES_WKR.consumes_FND_BND is defined %}
{% for priv_member in DES_WKR.consumes_FND_BND.members.private %}
{% for rndc_member in DES_WKR.consumes_FND_BND.members.bind_rndc %}
{% if priv_member.ip_address == rndc_member.ip_address %}

    - type: bind9
      description: BIND9 Server {{ priv_member.ip_address }}

      masters:
{% if DES_WKR.consumes_DES_MDN is defined %}
{% for mdn_member in DES_WKR.consumes_DES_MDN.members.private %}
        - host: {{ mdn_member.ip_address }}
          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}

      # BIND Configuration options
      options:
        host: {{ priv_member.ip_address }}
        port: {{ priv_member.port }}
        rndc_host: {{ rndc_member.ip_address }}
        rndc_port: {{ rndc_member.port }}
        rndc_key_file: /etc/bind/rndc.key
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}

#
#    - type: infoblox
#      description: infoblox Cluster
#
#      masters:
{% if DES_WKR.consumes_DES_MDN_EXT is defined %}
{% for mdn_member in DES_WKR.consumes_DES_MDN_EXT.members.private %}
#        - host: {{ mdn_member.ip_address }}
#          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}
#
#      options:
#        wapi_url: https://127.0.0.1/wapi/v2.2.2/
#        username: admin
#        password: infoblox
#        ns_group: designate
#        sslverify: False
#        dns_view: default
#        network_view: default
#
#
#    - type: dynect
#      description: DynECT API
#
#      options:
#        customer_name: dynect_customer
#        username: dynect_username
#        password: dynect_password
#
#      masters:
{% if DES_WKR.consumes_DES_MDN_EXT is defined %}
{% for mdn_member in DES_WKR.consumes_DES_MDN_EXT.members.private %}
#        - host: {{ mdn_member.ip_address }}
#          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}
#
#  also_notifies:
   # This is the list of DynECT's xfr-in server IP addresses,
   # a up to date list can be obtained from your Dyn account manager.
#    - host: 204.13.249.65
#      port: 53
#    - host: 208.78.68.65
#      port: 53
#
#
#    - type: akamai
#      description: Akamai Server
#
#      options:
#        username: akamai_username
#        password: akamai_password
#
#      masters:
{% if DES_WKR.consumes_DES_MDN_EXT is defined %}
{% for mdn_member in DES_WKR.consumes_DES_MDN_EXT.members.private %}
#        - host: {{ mdn_member.ip_address }}
#          port: {{ mdn_member.port }}
{% endfor %}
{% endif %}
#
#  also_notifies:
   # This is the list of Akamai's zone transfer agent (ZTA) server IP
   # addresses, a up to date list can be obtained from your Akamai
   # account manager.
#    - host: 193.108.155.34
#      port: 53
#    - host: 23.73.134.141
#      port: 53
#    - host: 80.67.64.148
#      port: 53
#    - host: 23.73.134.237
#      port: 53
#    - host: 23.73.133.141
#      port: 53
#    - host: 23.73.133.237
#      port: 53
#    - host: 80.67.64.10
#      port: 53
#    - host: 72.246.0.10
#      port: 53
#    - host: 72.247.45.157
#      port: 53
#    - host: 72.246.192.168
#      port: 53
#    - host: 193.108.152.143
#      port: 53
#    - host: 60.254.128.45
#      port: 53
#    - host: 72.247.45.110
#      port: 53
#    - host: 72.247.45.65
#      port: 53
#    - host: 72.247.45.25
#      port: 53
070701000000ED000081A40000000000000000000000015DCB325C000003CD000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates/rndc.key.j2{#
#
# (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.
#
#}
// This file has been generated by ansible from
// designate-worker/templates/rndc.key.j2
// It contains the Ardana OpenStack values that apply only to the bind
// service. You may make changes to this file by adding
// sections/options below.

key "rndc-key" {
    algorithm hmac-md5;
    secret "{{ designate_rndc_key }}";
};
070701000000EE000081A40000000000000000000000015DCB325C0000069C000000000000000000000000000000000000006400000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates/worker-logging.conf.j2{#
#
# (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.
#
#}
[loggers]
keys: root

[handlers]
keys: watchedfile, logstash

[formatters]
keys: context, logstash


[logger_root]
qualname: root
handlers: watchedfile, logstash
level: NOTSET


# Writes to disk
[handler_watchedfile]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-worker.log',)
formatter: context
level: INFO

# Writes JSON to disk, beaver will ship to logstash
[handler_logstash]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-worker-json.log',)
formatter: logstash
level: INFO

# datefmt must be set otherwise you end up with too many (msecs) fields
[formatter_context]
class: oslo_log.formatters.ContextFormatter
args: (datefmt=datefmt)
format: %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(tenant)s] %(instance)s%(message)s
datefmt: %Y-%m-%d %H:%M:%S

# the "format" and "datefmt" actually set the "type" and "tags"
[formatter_logstash]
class: logstash.LogstashFormatterVersion1
format: designate
datefmt: designate-worker
070701000000EF000081A40000000000000000000000015DCB325C00000551000000000000000000000000000000000000005C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-worker/templates/worker.conf.j2{#
#
# (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.
#
#}
# This file has the Ardana OpenStack values that apply only to the Designate Pool
# Manager service. You may make changes to this file by adding
# sections/options below.
[DEFAULT]
# Logging
log_config_append = "{{ designate_service_conf_dir }}/worker-logging.conf"

# End of [DEFAULT] section

[service:worker]
pool_id = {{ designate_pool_id }}
cache_driver = memcache
enabled = True
notify = True

# End of [service:worker] section

[worker_cache:memcache]
memcached_servers = {{ designate_worker_memcached_servers }}

# End of [worker_cache:memcache] section

[coordination]
backend_url = {{ designate_backend_url }}

# End of [coordination] section

### End of File ###
## Do NOT put anything after this line ##
070701000000F0000041ED0000000000000000000000075DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager070701000000F1000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/defaults070701000000F2000081A40000000000000000000000015DCB325C00000534000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/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.
#
# This file will contain the default values for the designate-zone-manager service
---
designate_component: designate-zone-manager

# packages listed here will be installed by designate-common | install
designate_required_packages:
  - libmysqlclient18

# packages listed here will trigger a restart of the service when updated
designate_zone_manager_restart_packages:
  - libmysqlclient18

# zone-manager.conf
## [service:zone_manager]

## [coordination]
designate_backend_url: "zookeeper://{% for node in DES_ZMG.consumes_FND_ZOO.members.private %}{{ node.host }}:{{ node.port }}{% if not loop.last %},{% endif %}{% endfor %}"

#designate_pool_id:  794ccc2c-d751-44fe-b57f-8894c9f5c842
070701000000F3000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/handlers070701000000F4000081A40000000000000000000000015DCB325C00000288000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/handlers/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.
#
---
070701000000F5000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004E00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/meta070701000000F6000081A40000000000000000000000015DCB325C000002B1000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/meta/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.
#
---
dependencies:
  - role: designate-common
070701000000F7000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/tasks070701000000F8000081A40000000000000000000000015DCB325C000003DF000000000000000000000000000000000000006B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/tasks/check_upgraded_packages.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.
#
---

- name: designate-zone-manager | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in designate-zone-manager package dependency - {{ item }}"
  register: ardana_notify_designate_zone_manager_restart_required
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_zone_manager_restart_packages
070701000000F9000081A40000000000000000000000015DCB325C0000091B000000000000000000000000000000000000005D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
#
# 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.
#
# Configure the designate-zone-manager service
---
- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_zone_manager_venv_changed }}"

- include: ../../designate-common/tasks/configure.yml

- name: "designate-zone-manager | configure | Notify on rootwrap change"
  shell: echo "notify rootwrap change"
  register: ardana_notify_designate_zone_manager_restart_required
  when: rootwrap_changed

- include: ../../designate-common/tasks/_write_conf.yml
  src: "../../designate-zone-manager/templates/zone-manager.conf.j2"
  dest: "zone-manager.conf"

# write_conf_result is set within the _write_conf.yml task, and
# is still available for us once the _write_conf task completes.
- name: "designate-zone-manager | configure | Notify on zone-manager.conf change"
  shell: echo "notify change"
  register: ardana_notify_designate_zone_manager_restart_required
  when: write_conf_result.changed

- name: "designate-zone-manager | configure | Apply template: {{ item }}"
  become: yes
  template:
    src: "{{ item }}.j2"
    dest: "{{ designate_service_conf_dir }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    mode: 0640
  with_items:
    - "zone-manager-logging.conf"
  register: ardana_notify_designate_zone_manager_restart_required

- name: "designate-zone-manager | configure | set designate log file ownership"
  become: yes
  file:
    path: "{{ designate_log_file_location }}/{{ item }}"
    owner: "{{ designate_system_user }}"
    group: "{{ designate_log_file_group }}"
    mode: 0640
    state: touch
  with_items:
    - designate-zone-manager.log
    - designate-zone-manager-json.log
070701000000FA000081A40000000000000000000000015DCB325C000008DB000000000000000000000000000000000000005B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/tasks/install.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.
#
# Install designate-zone-manager service
---

- name: designate-zone-manager | install | Update installed packager cache
  become: yes
  install_package:
    cache: update

- name: designate-zone-manager | install | Install the designate-zone-manager service from the designate venv
  become: yes
  install_package:
    name: designate
    service: designate-zone-manager
    state: present
    activate: act_off
  register: ardana_notify_designate_zone_manager_venv_changed

- name: "designate-zone-manager | install | Notify for restart on venv change"
  shell: echo "notify venv change"
  register: ardana_notify_designate_zone_manager_restart_required
  when: ardana_notify_designate_zone_manager_venv_changed.changed

- include: ../../designate-common/tasks/_set_directories.yml
  vars:
    install_package_result: "{{ ardana_notify_designate_zone_manager_venv_changed }}"

- name: designate-zone-manager | install | Setup designate-zone-manager service
  become: yes
  setup_systemd:
    service: designate-zone-manager
    user: "{{ designate_system_user }}"
    group: "{{ designate_system_group }}"
    cmd: designate-zone-manager
    args: >
      --config-file={{ designate_service_conf_dir }}/designate.conf
      --config-file={{ designate_service_conf_dir }}/zone-manager.conf

- name: designate-zone-manager | install | Set designate-zone-manager service to not start on boot
  become: yes
  service:
    name: designate-zone-manager
    enabled: no

# This must happen after the install_package, or a path which is meant to be a
# symlink will be mkdir'd
- include: ../../designate-common/tasks/install.yml
070701000000FB000081A40000000000000000000000015DCB325C00000639000000000000000000000000000000000000005900000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/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.
#
# Restart or start the designate-zone-manager service
---

- name: designate-zone-manager | start | Activate the latest installed version
  become: yes
  install_package:
    name: designate
    service: designate-zone-manager
    activate: act_on
    version: "{{ ardana_notify_designate_zone_manager_venv_changed.version }}"
  when: ardana_notify_designate_zone_manager_venv_changed is defined

- name: designate-zone-manager | start | Restart designate-zone-manager service
  become: yes
  service: name=designate-zone-manager state=restarted
  when: (ardana_notify_designate_zone_manager_restart_required is defined and ardana_notify_designate_zone_manager_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: designate-zone-manager | start | Start designate-zone-manager service
  become: yes
  service: name=designate-zone-manager state=started
070701000000FC000081A40000000000000000000000015DCB325C000002C5000000000000000000000000000000000000005A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/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: ../../designate-common/tasks/_service_status.yml
070701000000FD000081A40000000000000000000000015DCB325C000003AC000000000000000000000000000000000000005800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/tasks/stop.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.
#
# Stop the designate-zone-manager service
---
- name: designate-zone-manager | stop | stop designate-zone-manager service
  become: yes
  service: name=designate-zone-manager state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
070701000000FE000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/templates070701000000FF000081A40000000000000000000000015DCB325C000006B3000000000000000000000000000000000000007000000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/templates/zone-manager-logging.conf.j2{#
#
# (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.
#
#}
[loggers]
keys: root

[handlers]
keys: watchedfile, logstash

[formatters]
keys: context, logstash


[logger_root]
qualname: root
handlers: watchedfile, logstash
level: NOTSET


# Writes to disk
[handler_watchedfile]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-zone-manager.log',)
formatter: context
level: INFO

# Writes JSON to disk, beaver will ship to logstash
[handler_logstash]
class: handlers.WatchedFileHandler
args: ('{{ designate_log_file_location }}/designate-zone-manager-json.log',)
formatter: logstash
level: INFO

# datefmt must be set otherwise you end up with too many (msecs) fields
[formatter_context]
class: oslo_log.formatters.ContextFormatter
args: (datefmt=datefmt)
format: %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(tenant)s] %(instance)s%(message)s
datefmt: %Y-%m-%d %H:%M:%S

# the "format" and "datefmt" actually set the "type" and "tags"
[formatter_logstash]
class: logstash.LogstashFormatterVersion1
format: designate
datefmt: designate-zone-manager
07070100000100000081A40000000000000000000000015DCB325C00000447000000000000000000000000000000000000006800000000ardana-designate-8.0+git.1573597788.15b7984/roles/designate-zone-manager/templates/zone-manager.conf.j2{#
#
# (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.
#
#}
# This file has the Ardana values that apply only to the Designate Pool
# Manager service. You may make changes to this file by adding
# sections/options below.

[DEFAULT]
# Logging
log_config_append = "{{ designate_service_conf_dir }}/zone-manager-logging.conf"

# End of [DEFAULT] section

[coordination]
backend_url = {{ designate_backend_url }}

# End of [coordination] section

### End of File ###
## Do NOT put anything after this line ##
07070100000101000041ED0000000000000000000000085DCB325C00000000000000000000000000000000000000000000003B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns07070100000102000041ED0000000000000000000000045DCB325C00000000000000000000000000000000000000000000004300000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-monasca07070100000103000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004800000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-monasca/meta07070100000104000081A40000000000000000000000015DCB325C000002D2000000000000000000000000000000000000005100000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-monasca/meta/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.
#
---
dependencies:
  - role: powerdns
  - {role: monasca-agent, run_mode: Use}
07070100000105000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-monasca/tasks07070100000106000081A40000000000000000000000015DCB325C000002FF000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-monasca/tasks/start.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.
#
---

- name: powerdns-monasca | start | Monitor the PowerDNS process
  become: yes
  monasca_agent_plugin:
    name: "powerdns"
07070100000107000041ED0000000000000000000000065DCB325C00000000000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure07070100000108000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005300000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/defaults07070100000109000081A40000000000000000000000015DCB325C00000433000000000000000000000000000000000000005C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/defaults/main.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (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.
#
---

mysql:
  host: "{{ DES_CEN.consumes_FND_MDB.vips.private[0].host }}"
  login_password: "{{ FND_MDB.vars.mysql_root_pwd | quote }}"
  login_user: "{{ FND_MDB.vars.mysql_root_user }}"
  powerdns_admin_user: "{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.username }}"
  powerdns_admin_password: "{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.password | quote }}"

powerdns_pool_id: 794ccc2c-d751-44fe-b57f-8894c9f5c842
0707010000010A000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005000000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/files0707010000010B000081A40000000000000000000000015DCB325C00000C5B000000000000000000000000000000000000006B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/files/backend-pdns4-mysql-db.sql/*
 SQL statements to create tables in designate_pdns DB.
 Note: This file is taken as is from:
 https://raw.githubusercontent.com/openstack/designate/master/devstack/designate_plugins/backend-pdns4-mysql-db.sql
*/
CREATE TABLE domains (
  id                    INT AUTO_INCREMENT,
  name                  VARCHAR(255) NOT NULL,
  master                VARCHAR(128) DEFAULT NULL,
  last_check            INT DEFAULT NULL,
  type                  VARCHAR(6) NOT NULL,
  notified_serial       INT DEFAULT NULL,
  account               VARCHAR(40) DEFAULT NULL,
  PRIMARY KEY (id)
) Engine=InnoDB;

CREATE UNIQUE INDEX name_index ON domains(name);


CREATE TABLE records (
  id                    INT AUTO_INCREMENT,
  domain_id             INT DEFAULT NULL,
  name                  VARCHAR(255) DEFAULT NULL,
  type                  VARCHAR(10) DEFAULT NULL,
  -- Changed to "TEXT", as VARCHAR(65000) is too big for most MySQL installs
  content               TEXT DEFAULT NULL,
  ttl                   INT DEFAULT NULL,
  prio                  INT DEFAULT NULL,
  change_date           INT DEFAULT NULL,
  disabled              TINYINT(1) DEFAULT 0,
  ordername             VARCHAR(255) BINARY DEFAULT NULL,
  auth                  TINYINT(1) DEFAULT 1,
  PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE INDEX recordorder ON records (domain_id, ordername);


CREATE TABLE supermasters (
  ip                    VARCHAR(64) NOT NULL,
  nameserver            VARCHAR(255) NOT NULL,
  account               VARCHAR(40) NOT NULL,
  PRIMARY KEY (ip, nameserver)
) Engine=InnoDB;


CREATE TABLE comments (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  name                  VARCHAR(255) NOT NULL,
  type                  VARCHAR(10) NOT NULL,
  modified_at           INT NOT NULL,
  account               VARCHAR(40) NOT NULL,
  -- Changed to "TEXT", as VARCHAR(65000) is too big for most MySQL installs
  comment               TEXT NOT NULL,
  PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX comments_domain_id_idx ON comments (domain_id);
CREATE INDEX comments_name_type_idx ON comments (name, type);
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);


CREATE TABLE domainmetadata (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  kind                  VARCHAR(32),
  content               TEXT,
  PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);


CREATE TABLE cryptokeys (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  flags                 INT NOT NULL,
  active                BOOL,
  content               TEXT,
  PRIMARY KEY(id)
) Engine=InnoDB;

CREATE INDEX domainidindex ON cryptokeys(domain_id);


CREATE TABLE tsigkeys (
  id                    INT AUTO_INCREMENT,
  name                  VARCHAR(255),
  algorithm             VARCHAR(50),
  secret                VARCHAR(255),
  PRIMARY KEY (id)
) Engine=InnoDB;

CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);
0707010000010C000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/meta0707010000010D000081A40000000000000000000000015DCB325C000002ED000000000000000000000000000000000000005800000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/meta/main.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.
#
---
dependencies:
  - role: designate-common
  - role: designate-pool-manager
  - role: designate-worker
0707010000010E000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000005000000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/tasks0707010000010F000081A40000000000000000000000015DCB325C00000BAE000000000000000000000000000000000000006100000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns-post-configure/tasks/db_configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (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.
#
# Designate PowerDNS Database
---

# Note designate PowerDNS backend DB schema has changed for
# pdns4 backend driver corresponding to PowerDNS v4+.
# This change is not handled by DB migration scripts.
# Upstream bug: https://bugs.launchpad.net/designate/+bug/1746836
# Our strategy mirrors what is being done in devstack.
# On finding old schema we remove the tables and recreate it.

- name: powerdns-post-configure | db_configure | Check if DB is empty
  become: yes
  command: mysql -e
          "SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
          WHERE TABLE_SCHEMA = 'designate_pdns';"
  register: is_db_empty_result
  ignore_errors: True

- name: powerdns-post-configure | db_configure | Set fact db_empty
  set_fact:
    designate_pdns_db_empty: "{{ is_db_empty_result.stdout_lines[1] == '0' }}"

# Note: column 'designate_id' only exists in Old DB Schema
- name: powerdns-post-configure | db_configure | Check if DB has old schema
  become: yes
  command: mysql -e
          "SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
          WHERE TABLE_SCHEMA = 'designate_pdns' AND
          TABLE_NAME = 'domains' AND COLUMN_NAME = 'designate_id';"
  register: is_old_schema_result
  ignore_errors: True

- name: powerdns-post-configure | db_configure | Set fact old_schema
  set_fact:
    designate_pdns_old_schema:
      "{{ is_old_schema_result.stdout_lines[1] == '1' }}"

- name: powerdns-post-configure | db_configure | Drop designate_pdns DB tables
  become: yes
  command: mysql designate_pdns -e "DROP TABLE IF EXISTS {{ item }};"
  with_items:
    - comments
    - cryptokeys
    - domainmetadata
    - records
    - supermasters
    - tsigkeys
    - domains
  run_once_per: verb_hosts.FND_MDB
  when: designate_pdns_old_schema|bool

- name: powerdns-post-configure | db_configure | Copy the pdns4 SQL file
  become: yes
  copy:
    src: backend-pdns4-mysql-db.sql
    dest: /tmp/backend-pdns4-mysql-db.sql
    owner: root
    group: root
    mode: 0740
  run_once_per: verb_hosts.FND_MDB
  when: designate_pdns_old_schema|bool or designate_pdns_db_empty|bool

- name: powerdns-post-configure | db_configure | Recreate designate_pdns tables
  become: yes
  shell: mysql designate_pdns < /tmp/backend-pdns4-mysql-db.sql
  run_once_per: verb_hosts.FND_MDB
  when: designate_pdns_old_schema|bool or designate_pdns_db_empty|bool
07070100000110000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004400000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/defaults07070100000111000081A40000000000000000000000015DCB325C0000070B000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/defaults/main.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (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.
#
# This file will contain the default values for the designate-central service
---
designate_component: powerdns

# pdns.conf
## database config
designate_powerdns_gmysql_dbname: "{{ FND_PDN.consumes_FND_MDB.vars.databases.powerdns.dbname }}"
designate_powerdns_gmysql_host: "{{ FND_PDN.consumes_FND_MDB.vips.private[0].ip_address }}"
designate_powerdns_gmysql_user: "{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.username }}"
designate_powerdns_gmysql_password: "{{ FND_PDN.consumes_FND_MDB.vars.accounts.powerdns.password }}"

##  bind address and port
designate_powerdns_local_address: "{{ host.bind.FND_PDN.internal.ip_address }}{% if host.bind.FND_PDN.internal.ip_address != host.bind.FND_PDN_EXT.public.ip_address %},{{ host.bind.FND_PDN_EXT.public.ip_address }}{% endif %}"
designate_powerdns_local_port: "{{ host.bind.FND_PDN.internal.port }}"

# pdns webserver address
designate_powerdns_webserver_address: "{{ host.bind.FND_PDN.internal.ip_address }}"

# Find me a home
designate_powerdns_pool_target_id: 00000000-0000-0001-0002-000000000001

# API Key
designate_powerdns_api_key: "{{ FND_PDN | item('vars.pdns_api_key', default='changeme') }}"
07070100000112000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004400000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/handlers07070100000113000081A40000000000000000000000015DCB325C00000288000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/handlers/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.
#
---
07070100000114000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/meta07070100000115000081A40000000000000000000000015DCB325C000002B1000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/meta/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.
#
---
dependencies:
  - role: designate-common
07070100000116000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004100000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/tasks07070100000117000081A40000000000000000000000015DCB325C00000316000000000000000000000000000000000000005700000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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: powerdns | _schedule_restart | Schedule a restart for powerdns services
  debug:
    msg: "Trigger a change notification in pdns"
  changed_when: true
  register: ardana_notify_powerdns_restart_required07070100000118000081A40000000000000000000000015DCB325C000003AC000000000000000000000000000000000000005D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/tasks/check_upgraded_packages.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.
#
---

- name: powerdns | check_upgraded_packages | Check upgraded packages
  shell: echo "Notify change in powerdns package dependency - {{ item }}"
  when: item in ardana_upgraded_pkgs | default({})
  with_items: designate_powerdns_restart_packages
  register: ardana_notify_powerdns_restart_required
07070100000119000081A40000000000000000000000015DCB325C000003C5000000000000000000000000000000000000004F00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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.
#
# PDNS Config Database
---

- name: "powerdns | configure | Write Config file"
  become: yes
  template:
    src: "pdns.conf.j2"
    dest: "{{ designate_powerdns_conf_dir }}/pdns.conf"
    owner: "root"
    group: "{{ designate_powerdns_system_group }}"
    mode: 0640
  register: ardana_notify_powerdns_restart_required
0707010000011A000081A40000000000000000000000015DCB325C000003BA000000000000000000000000000000000000004D00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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.
#
# Install PowerDNS
---

- name: powerdns | install | Install Power DNS packages
  become: yes
  package:
    name: "{{ item }}"
    state: present
  with_items: powerdns_packages

- name: powerdns | install | Set Power DNS service to start on boot
  become: yes
  service:
    name: pdns
    enabled: yes
0707010000011B000081A40000000000000000000000015DCB325C000002ED000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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: powerdns | main | Set os-specific variables
  include_vars: "{{ ansible_os_family | lower }}.yml"
0707010000011C000081A40000000000000000000000015DCB325C000006CF000000000000000000000000000000000000004B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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.
#
# Restart or start the power dns service
---
- name: powerdns | start | Verify  port/ip is being already used
  shell: sudo netstat -antlpu | grep -v pdns_server | awk '$6 == "LISTEN" && ($4 ~ /{{ host.bind.FND_PDN.internal.ip_address }}:{{ designate_powerdns_local_port }}$/ || $4  ~ /{{ host.bind.FND_PDN_EXT.public.ip_address }}:{{ designate_powerdns_local_port }}$/ || $4 ~ /0.0.0.0:{{ designate_powerdns_local_port }}$/)'
  register: shell_result
  ignore_errors: True

- name: powerdns | start | Fail the playbook when powerdns_ip/port is being used by other process
  fail:
      msg='powerdns_ip/port is being used by other process'
  when: shell_result.stdout

- name: powerdns | start | Restart pdns service
  become: yes
  service: name=pdns state=restarted
  when: (ardana_notify_powerdns_restart_required is defined and ardana_notify_powerdns_restart_required.changed) or
      (ardana_notify_designate_restart_required is defined and ardana_notify_designate_restart_required.changed)

- name: powerdns | start | Start power dns service
  become: yes
  service: name=pdns state=started
0707010000011D000081A40000000000000000000000015DCB325C000004BE000000000000000000000000000000000000004C00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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: powerdns | status | Print service being checked
  debug:
    msg: "Running service check for power dns"
  run_once: true

- name: powerdns | status | Check systemd service running
  command: systemctl status pdns
  ignore_errors: yes
  changed_when: false
  register: systemctl_status_result

- name: powerdns | status | Report status of power dns
  fail:
    msg: |
      pdns is not running.
      systemctl status pdns output:
      {{ systemctl_status_result.stdout }}
      {{ systemctl_status_result.stderr }}
  when: systemctl_status_result | failed
0707010000011E000081A40000000000000000000000015DCB325C0000037A000000000000000000000000000000000000004A00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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.
#
# Stop the designate-central service
---
- name: powerdns | stop | stop power dns service
  become: yes
  service: name=pdns state=stopped
  register: stop_result
  failed_when: "stop_result|failed and 'service not found' not in stop_result.msg"
0707010000011F000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004500000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/templates07070100000120000081A40000000000000000000000015DCB325C000006BC000000000000000000000000000000000000005200000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/templates/pdns.conf.j2{#
#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (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.
#
#}
# This file has the Ardana Openstack values that apply only to the
# Designate PowerDNS service. You may make changes to this file by adding
# sections/options below.

# General Config
setgid=pdns
setuid=pdns
config-dir=/etc/powerdns
socket-dir=/var/run
guardian=yes
daemon=yes
disable-axfr=no
local-address={{ designate_powerdns_local_address }}
local-port={{ designate_powerdns_local_port }}
master=no
slave=yes
cache-ttl=0
query-cache-ttl=0
negquery-cache-ttl=0
out-of-zone-additional-processing=no
do-ipv6-additional-processing=no
security-poll-suffix=

# Set the backend
launch=gmysql

# gmysql parameters
gmysql-host={{ designate_powerdns_gmysql_host }}
gmysql-user={{ designate_powerdns_gmysql_user }}
gmysql-password={{ designate_powerdns_gmysql_password }}
gmysql-dbname={{ designate_powerdns_gmysql_dbname }}
gmysql-dnssec=yes

# enable API
webserver=yes
webserver-address={{ designate_powerdns_webserver_address }}
webserver-allow-from=0.0.0.0/0,::/0
api=yes
api-key={{ designate_powerdns_api_key }}

### End of File ###
## Do NOT put anything after this line ##
07070100000121000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000004000000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/vars07070100000122000081A40000000000000000000000015DCB325C000003CB000000000000000000000000000000000000004B00000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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.
#
---
powerdns_packages:
  - pdns-server
  - pdns-backend-mysql

# packages listed here will trigger a restart of the service when updated
designate_powerdns_restart_packages:
  - pdns-server
  - pdns-backend-mysql

designate_powerdns_conf_dir: /etc/powerdns
designate_powerdns_system_user: pdns
designate_powerdns_system_group: pdns
07070100000123000081A40000000000000000000000015DCB325C000003B9000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/roles/powerdns/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.
#
---
powerdns_packages:
  - pdns
  - pdns-backend-mysql

# packages listed here will trigger a restart of the service when updated
designate_powerdns_restart_packages:
  - pdns
  - pdns-backend-mysql

designate_powerdns_conf_dir: /etc/pdns
designate_powerdns_system_user: pdns
designate_powerdns_system_group: pdns
07070100000124000041ED0000000000000000000000025DCB325C00000000000000000000000000000000000000000000003200000000ardana-designate-8.0+git.1573597788.15b7984/sos.d07070100000125000081A40000000000000000000000015DCB325C00000472000000000000000000000000000000000000004900000000ardana-designate-8.0+git.1573597788.15b7984/sos.d/openstack_designate.py#
# (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.
#

import os
import os.path
from sos.plugins import Plugin, DebianPlugin


class OpenStackDesignate(Plugin):
    """OpenStackDesignate related information
    """
    plugin_name = "OpenStackDesignate"


class DebianOpenStackDesignate(OpenStackDesignate, DebianPlugin):
    """OpenStackDesignate related information for Debian distributions
    """

    def setup(self):
        super(DebianOpenStackDesignate, self).setup()

        self.add_copy_spec([
            "/var/log/designate/",
        ])
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!665 blocks
openSUSE Build Service is sponsored by