File ardana-swift-8.0+git.1551502730.f4d219d.obscpio of Package ardana-swift

07070100000000000081A40000000000000000000000015C7A0D8A00000023000000000000000000000000000000000000003900000000ardana-swift-8.0+git.1551502730.f4d219d/.copyrightignoreroles/_SWF-RSY/files/rsync.service
07070100000001000081A40000000000000000000000015C7A0D8A00000081000000000000000000000000000000000000003300000000ardana-swift-8.0+git.1551502730.f4d219d/.gitreview[gerrit]
host=gerrit.suse.provo.cloud
port=29418
project=ardana/swift-ansible.git
defaultremote=ardana
defaultbranch=stable/pike
07070100000002000081A40000000000000000000000015C7A0D8A0000000C000000000000000000000000000000000000003600000000ardana-swift-8.0+git.1551502730.f4d219d/.rsync-filter- ardana-ci
07070100000003000081A40000000000000000000000015C7A0D8A0000279F000000000000000000000000000000000000003000000000ardana-swift-8.0+git.1551502730.f4d219d/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.

07070100000004000081A40000000000000000000000015C7A0D8A0000124C000000000000000000000000000000000000003200000000ardana-swift-8.0+git.1551502730.f4d219d/README.md
(c) Copyright 2015 Hewlett Packard Enterprise Development LP
(c) Copyright 2017 SUSE LLC

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

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

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


README
======

The swift repo will have the following roles:
- SWF-PRX
- SWF-CMN
- SWF-ACC
- SWF-CON
- SWF-OBJ

In time the role names, specified in the configuration processor will change
to: swift-proxy, swift-common, swift-account, swift-container and
swift-object.

The service verbs are:
- install
- configure
- start
- stop

An example of the swift-ansible structure:
```
└── swift-ansible
    ├── filter_plugins
    ├── library
    ├── README.md
    └── roles
        ├── swift
        │   ├── defaults
        │   ├── files
        │   ├── handlers
        │   ├── meta
        │   ├── tasks
        │   │   └── swift-deploy.yml
        │   ├── templates
        │   └── vars
        ├── swift-account
        │   ├── defaults
        │   ├── files
        │   ├── handlers
        │   ├── meta
        │   ├── tasks
        │   │   ├── configure.yml
        │   │   ├── install.yml
        │   │   └── start.yml
        │   ├── templates
        │   └── vars
        ├── swift-common
        │   ├── defaults
        │   ├── files
        │   ├── handlers
        │   ├── meta
        │   ├── tasks
        │   │   ├── configure.yml
        │   │   └── install.yml
        │   ├── templates
        │   └── vars
        ├── swift-container
        │   ├── defaults
        │   ├── files
        │   ├── handlers
        │   ├── meta
        │   ├── tasks
        │   │   ├── configure.yml
        │   │   ├── install.yml
        │   │   └── start.yml
        │   ├── templates
        │   └── vars
        ├── swift-object
        │   ├── defaults
        │   ├── files
        │   ├── handlers
        │   ├── meta
        │   ├── tasks
        │   │   ├── configure.yml
        │   │   ├── install.yml
        │   │   └── start.yml
        │   ├── templates
        │   └── vars
        └── swift-proxy
            ├── defaults
            ├── files
            ├── handlers
            ├── meta
            ├── tasks
            │   ├── configure.yml
            │   ├── install.yml
            │   └── start.yml
            ├── templates
            └── vars

```

Note that the "swift-common" role does not have a "start" verb, since that role
only installs and populates configuration files that are common to the other
Swift roles.

install_package results
-----------------------
The install_package module, used to install the swift and swiftlm venvs and also
create the various swift services, like swift-proxy-server, produces a rather
large result structure that is stored in variables like swift_proxy_install_result.
This result is used to determine  if the package changed, what version is
installed. When called in a loop the result structure also includes the
part of the dictionary used when calling install_package. Here is an example of
the install_package result structure returned for the swift_proxy_server:

{
    "item": {
        "cache": null,
        "changed": false,
        "clean": false,
        "extra_mode_bits": 0,
        "group": "root",
        "invocation": {
            "module_args": "",
            "module_name": "install_package"
        },
        "item": {
            "key": "swift-proxy-server",
            "value": {
                "cmd": "swift-proxy-server",
                "main": true
        },
        "name": "swift",
        "service": "swift-proxy-server",
        "state": "present",
        "version": "20150824T073404Z"
        },
    }
}

07070100000005000081A40000000000000000000000015C7A0D8A00000804000000000000000000000000000000000000003D00000000ardana-swift-8.0+git.1551502730.f4d219d/_swift-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:
  - SWF-ACC
  - SWF-CON
  - SWF-OBJ
  - SWF-PRX
  roles:
  - _SWF-CMN
  tasks:
  - include: roles/_SWF-CMN/tasks/get_storage_policies_fact.yml

- hosts: SWF-RSY
  roles:
  - _SWF-RSY
  tasks:
  - include: roles/_SWF-RSY/tasks/configure.yml
    become: yes

- hosts: SWF-PRX
  roles:
    - SWF-PRX
    - access-tailer
  tasks:
  - include: roles/SWF-PRX/tasks/configure.yml
    become: yes
  - include: roles/access-tailer/tasks/configure.yml
    become: yes

- hosts: SWF-ACC
  roles:
  - SWF-ACC
  tasks:
  - include: roles/SWF-ACC/tasks/configure.yml
    become: yes

- hosts: SWF-CON
  roles:
  - SWF-CON
  tasks:
  - include: roles/SWF-CON/tasks/configure.yml
    become: yes

- hosts: SWF-OBJ
  roles:
  - SWF-OBJ
  tasks:
  - include: roles/SWF-OBJ/tasks/configure.yml
    become: yes

- hosts:
  - SWF-ACC
  - SWF-CON
  - SWF-OBJ
  - SWF-PRX
  roles:
  - swiftlm-ring-supervisor
  tasks:
  - include: roles/swiftlm-ring-supervisor/tasks/configure.yml
    become: yes
  - include: roles/swiftlm-ring-supervisor/tasks/deploy-rings.yml
    become: yes

# Play using internal role SWF-EXP applied to the first object server
- hosts: SWF-OBJ--first-member
  roles:
  - SWF-EXP
  tasks:
  - include: roles/SWF-EXP/tasks/configure.yml
    become: yes

- hosts: SWF-PRX--first-member
  roles:
  - swift-dispersion
  tasks:
  - include: roles/swift-dispersion/tasks/configure.yml
    become: yes
07070100000006000081A40000000000000000000000015C7A0D8A000003D5000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/_swift-functional-test-setup.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: SWF-PRX
  roles:
  - swift-functional
  tasks:
  - include: roles/swift-functional/tasks/make-testers.yml
    ansible_python_interpreter: "{{ KEY_CLI.vars.keystone_client_python_interpreter }}"
    become: yes

- hosts: SWF-PRX
  roles:
  - swift-functional
  tasks:
  - include: roles/swift-functional/tasks/configure.yml
07070100000007000081A40000000000000000000000015C7A0D8A00000556000000000000000000000000000000000000003B00000000ardana-swift-8.0+git.1551502730.f4d219d/_swift-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: SWF-PRX
  roles:
    - SWF-PRX
    - access-tailer
  tasks:
  - include: roles/SWF-PRX/tasks/install.yml
    become: yes
  - include: roles/access-tailer/tasks/install.yml
    become: yes

- hosts: SWF-ACC
  roles:
  - SWF-ACC
  tasks:
  - include: roles/SWF-ACC/tasks/install.yml
    become: yes

- hosts: SWF-CON
  roles:
  - SWF-CON
  tasks:
  - include: roles/SWF-CON/tasks/install.yml
    become: yes

- hosts: SWF-OBJ
  roles:
  - SWF-OBJ
  tasks:
  - include: roles/SWF-OBJ/tasks/install.yml
    become: yes

# Play using internal role SWF-EXP applied to the first object server
- hosts: SWF-OBJ--first-member
  roles:
  - SWF-EXP
  tasks:
  - include: roles/SWF-EXP/tasks/install.yml
    become: yes
07070100000008000081A40000000000000000000000015C7A0D8A000004F5000000000000000000000000000000000000004200000000ardana-swift-8.0+git.1551502730.f4d219d/_swift-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.
#
---

- hosts: SWF-PRX
  roles:
    - swift-post-configure
  # This task should be set to run-once
  tasks:
    - include: roles/swift-post-configure/tasks/keystone_conf.yml
      ansible_python_interpreter: "{{ KEY_CLI.vars.keystone_client_python_interpreter }}"

- hosts: SWF-ACC:SWF-CON:SWF-OBJ:SWF-PRX
  roles:
    - swift-post-configure
  tasks:
  - include: roles/swift-post-configure/tasks/swiftlm.yml
    become: yes

- include: swiftlm-uptime-monitor.yml
- include: swift-start.yml

# Configure swiftlm-aggregator after swift is up and running
- include: _swiftlm-aggregate.yml
- include: swift-configure-monasca.yml
07070100000009000081A40000000000000000000000015C7A0D8A000002E0000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/_swift-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 swift services using ardana_notify_... variables
- hosts: all
  tasks:
    - include: roles/_SWF-CMN/tasks/_schedule_restart.yml0707010000000A000081A40000000000000000000000015C7A0D8A00000313000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/_swiftlm-aggregate.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: SWF-PRX--first-member
  roles:
  - swiftlm-aggregate
  tasks:
  - include: roles/swiftlm-aggregate/tasks/configure.yml
    become: yes
0707010000000B000081A40000000000000000000000015C7A0D8A00000327000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/_swiftlm-provision.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: SWF-ACC:SWF-CON:SWF-OBJ:SWF-PRX
  roles:
    - swiftlm-provision
  tasks:
    - include: roles/swiftlm-provision/tasks/install.yml
      become: yes
0707010000000C000041ED0000000000000000000000085C7A0D8A00000000000000000000000000000000000000000000003200000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci0707010000000D000081A40000000000000000000000015C7A0D8A00000612000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/README.md# swift-ansible Ardana CI environment

The project environment is run automatically as a ci job when submitting a
swift-ansible patch. See the zuul job ardana-project-stack-test.

There are a number of other environments defined. These are used solely by
the developer i.e. they are not used by any CI job. The environment names
describe the general configuration. For example:

* cp1-keystone-swift
* cp1-keystone-swift-cp2-glance
* cp1-keystone-cp2-swift-cp3-glance
* cp1-keystone-cp2-swift-cp3-swift-cp4-glance

Use astack to build and deploy these environments. For example:

    cp ardana-dev-tools

    # Always good practice to cleanup your vagrant environment
    bin/cleanup-slave

    #  To build and deploy cp1-keystone-swift-cp2-glance:
    bin/astack.sh --project-stack ardana/swift-ansible cp1-keystone-swift-cp2-glance

    # If you don't need to re-build the venvs:
    bin/astack.sh --no-setup --no-build --project-stack ardana/swift-ansible cp1-keystone-swift-cp2-glance

Here are some useful astack command line options:

    --no-setup  Don't run dev-env-install.yml
    --no-build  Don't build venv, reuse existing packages
    --no-config Do not execute the config-processor
    --no-site   Do not execute the site.yml playbook during

To run the test plan:

    cd ardana-dev-tools/ardana-vagrant-models/project-vagrant
    ../../bin/test-project-stack.sh ardana/swift-ansible cp1-keystone-swift-cp2-glance

Note, the test plan is can be run against any environment, but it is designed
for running against the project environment.
0707010000000E000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000005400000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance0707010000000F000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000006000000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model07070100000010000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000006500000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data07070100000011000081A40000000000000000000000015C7A0D8A000010E3000000000000000000000000000000000000007700000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data/control_plane.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  control-planes:
    - name: cp1
      control-plane-prefix: cp1
      uses:
        - from: cp2
          service-components:
            - swift-proxy
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
#      configuration-data:
#        - SWIFT-CONFIG-CP1

      common-service-components:
        - lifecycle-manager-target

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          components:
            - rabbitmq
            - mysql
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp1.test
          cert-file: my-public-cp1-cert
          tls-components:
            - default
          roles:
            - public

      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER1-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - lifecycle-manager
            - lifecycle-manager-target
            - ntp-server
            - mysql
            - ip-cluster
            - keystone-api
            - rabbitmq
            - memcached
            - tempest

    - name: cp2
      control-plane-prefix: cp2
      uses:
        - from: cp1
          service-components:
            - all
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
      configuration-data:
        - SWIFT-CONFIG-CP2

      common-service-components:
        - lifecycle-manager-target
        - ntp-client

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          #components:
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp2.test
          cert-file: my-public-cp2-cert
          tls-components:
            - default
          roles:
            - public

      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER2-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - ip-cluster
            - swift-ring-builder
            - swift-proxy
            - swift-account
            - swift-container
            - swift-object

    - name: cp3
      control-plane-prefix: cp3
      uses:
        - from: cp1
          service-components:
            - all
        - from: cp2
          service-components:
            - swift-proxy
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
#      configuration-data:
#        - OCTAVIA-CONFIG-CP2
#        - NEUTRON-CONFIG-CP2
      common-service-components:
        - lifecycle-manager-target
        - ntp-client

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          components:
            - rabbitmq
            - mysql
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp4.test
          cert-file: my-public-cp4-cert
          tls-components:
            - default
          roles:
            - public

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

  disk-models:
  - name: DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /

          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file

          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file

  - name: SWIFT-DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /

          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file

          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file

    device-groups:
      - name: swiftobj
        devices:
          - name: /dev/sdb
          - name: /dev/sdc
          - name: /dev/sdd
          - name: /dev/sde
          - name: /dev/sdf
        consumer:
          name: swift
          attrs:
            rings:
              - account
              - container
              - object-0
07070100000013000081A40000000000000000000000015C7A0D8A0000051E000000000000000000000000000000000000007800000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data/network_groups.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.
#
---
  product:
    version: 2

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

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

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

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

#      routes:
#        - default

      load-balancers:
        - extlb
        - lb

    - name: EXTERNAL-VM
      tags:
        - neutron.l3_agent.external_network_bridge

07070100000014000081A40000000000000000000000015C7A0D8A0000044A000000000000000000000000000000000000007100000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data/regions.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

#    - name: region2
#      includes:
#        - control-plane: cp1
#          services:
#            - all
#        - control-plane: cp3
#          services:
#            - all

07070100000015000081A40000000000000000000000015C7A0D8A000003BC000000000000000000000000000000000000007600000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data/server_roles.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.
#
---
  product:
    version: 2

  server-roles:

    - name: SERVER1-ROLE
      interface-model: NET-INTERFACES
      disk-model: DISKS

    - name: SERVER2-ROLE
      interface-model: NET-INTERFACES
      disk-model: SWIFT-DISKS

    - name: SERVER3-ROLE
      interface-model: NET-INTERFACES
      disk-model: DISKS
07070100000016000081A40000000000000000000000015C7A0D8A000005D5000000000000000000000000000000000000007100000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data/servers.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

  servers:

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

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

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

07070100000017000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000006B00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data/swift07070100000018000081A40000000000000000000000015C7A0D8A0000060A000000000000000000000000000000000000007C00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-glance/input-model/data/swift/swift_config.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development  LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  configuration-data:
    - name: SWIFT-CONFIG-CP2
      services:
        - swift
      data:
        control_plane_rings:
          swift-zones:
            - id: 1
              server-groups:
                - CLOUD
          rings:
            - name: account
              display-name: Account Ring
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3

            - name: container
              display-name: Container Ring
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3

            - name: object-0
              display-name: General
              default: yes
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3
07070100000019000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000005E00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance0707010000001A000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000006A00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model0707010000001B000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000006F00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data0707010000001C000081A40000000000000000000000015C7A0D8A00001474000000000000000000000000000000000000008100000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/control_plane.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

      common-service-components:
        - lifecycle-manager-target

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          components:
            - rabbitmq
            - mysql
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp1.test
          cert-file: my-public-cp1-cert
          tls-components:
            - default
          roles:
            - public

      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER1-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - lifecycle-manager
            - lifecycle-manager-target
            - ntp-server
            - mysql
            - ip-cluster
            - keystone-api
            - rabbitmq
            - memcached
            - tempest

    - name: cp2
      control-plane-prefix: cp2
      uses:
        - from: cp1
          service-components:
            - all
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
      configuration-data:
        - SWIFT-CONFIG-CP2

      common-service-components:
        - lifecycle-manager-target
        - ntp-client

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          #components:
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp2.test
          cert-file: my-public-cp2-cert
          tls-components:
            - default
          roles:
            - public

      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER2-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - ip-cluster
            - swift-ring-builder
            - swift-proxy
            - swift-account
            - swift-container
            - swift-object

    - name: cp3
      control-plane-prefix: cp3
      uses:
        - from: cp1
          service-components:
            - all
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
      configuration-data:
        - SWIFT-CONFIG-CP3

      common-service-components:
        - lifecycle-manager-target
        - ntp-client

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          #components:
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp3.test
          cert-file: my-public-cp3-cert
          tls-components:
            - default
          roles:
            - public

      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER3-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - ip-cluster
            - swift-ring-builder
            - swift-proxy
            - swift-account
            - swift-container
            - swift-object

    - name: cp4
      control-plane-prefix: cp4
      uses:
        - from: cp1
          service-components:
            - all
        - from: cp2
          service-components:
            - swift-proxy
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
      common-service-components:
        - lifecycle-manager-target
        - ntp-client

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          components:
            - rabbitmq
            - mysql
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp4.test
          cert-file: my-public-cp4-cert
          tls-components:
            - default
          roles:
            - public
      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER4-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - mysql
            - ip-cluster
            - rabbitmq
            - glance-api
            - glance-registry
0707010000001D000081A40000000000000000000000015C7A0D8A00000ACA000000000000000000000000000000000000007900000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/disks.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  disk-models:
  - name: DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /

          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file

          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file

  - name: SWIFT-DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /

          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file

          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file

    device-groups:
      - name: swiftobj
        devices:
          - name: /dev/sdb
          - name: /dev/sdc
          - name: /dev/sdd
          - name: /dev/sde
          - name: /dev/sdf
        consumer:
          name: swift
          attrs:
            rings:
              - account
              - container
              - object-0
0707010000001E000081A40000000000000000000000015C7A0D8A0000051E000000000000000000000000000000000000008200000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/network_groups.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.
#
---
  product:
    version: 2

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

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

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

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

#      routes:
#        - default

      load-balancers:
        - extlb
        - lb

    - name: EXTERNAL-VM
      tags:
        - neutron.l3_agent.external_network_bridge

0707010000001F000081A40000000000000000000000015C7A0D8A00000442000000000000000000000000000000000000007B00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/regions.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

    - name: region2
      includes:
        - control-plane: cp1
          services:
            - all
        - control-plane: cp3
          services:
            - all

07070100000020000081A40000000000000000000000015C7A0D8A0000041A000000000000000000000000000000000000008000000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/server_roles.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.
#
---
  product:
    version: 2

  server-roles:

    - name: SERVER1-ROLE
      interface-model: NET-INTERFACES
      disk-model: DISKS

    - name: SERVER2-ROLE
      interface-model: NET-INTERFACES
      disk-model: SWIFT-DISKS

    - name: SERVER3-ROLE
      interface-model: NET-INTERFACES
      disk-model: SWIFT-DISKS

    - name: SERVER4-ROLE
      interface-model: NET-INTERFACES
      disk-model: DISKS
07070100000021000081A40000000000000000000000015C7A0D8A000006C4000000000000000000000000000000000000007B00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/servers.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

  servers:

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

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

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

    - id: server4
      ip-addr: 192.168.110.6
      role: SERVER4-ROLE
      server-group: RACK3
      mac-addr: 26:67:3e:49:5a:a7
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.6
      ilo-password: password
      ilo-user: admin

07070100000022000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000007500000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/swift07070100000023000081A40000000000000000000000015C7A0D8A00000960000000000000000000000000000000000000008600000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-cp2-swift-cp3-swift-cp4-glance/input-model/data/swift/swift_config.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development  LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  configuration-data:
    - name: SWIFT-CONFIG-CP2
      services:
        - swift
      data:
        control_plane_rings:
          swift-zones:
            - id: 1
              server-groups:
                - CLOUD
          rings:
            - name: account
              display-name: Account Ring
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3

            - name: container
              display-name: Container Ring
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3

            - name: object-0
              display-name: General
              default: yes
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3
    - name: SWIFT-CONFIG-CP3
      services:
        - swift
      data:
        control_plane_rings:
          swift-zones:
            - id: 1
              server-groups:
                - CLOUD
          rings:
            - name: account
              display-name: Account Ring
              min-part-hours: 16
              partition-power: 13
              replication-policy:
                replica-count: 3

            - name: container
              display-name: Container Ring
              min-part-hours: 16
              partition-power: 13
              replication-policy:
                replica-count: 3

            - name: object-0
              display-name: General
              default: yes
              min-part-hours: 16
              partition-power: 13
              replication-policy:
                replica-count: 3

07070100000024000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift07070100000025000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance07070100000026000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000005C00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model07070100000027000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000006100000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model/data07070100000028000081A40000000000000000000000015C7A0D8A00000C2B000000000000000000000000000000000000007300000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model/data/control_plane.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  control-planes:
    - name: cp1
      control-plane-prefix: cp1
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
      configuration-data:
        - SWIFT-CONFIG-CP1

      common-service-components:
        - lifecycle-manager-target

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          components:
            - default
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp1.test
          cert-file: my-public-cp1-cert
          tls-components:
            - default
          roles:
            - public

      clusters:
        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER1-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - lifecycle-manager
            - lifecycle-manager-target
            - ntp-server
            - mysql
            - ip-cluster
            - keystone-api
            - rabbitmq
            - swift-ring-builder
            - swift-proxy
            - swift-account
            - swift-container
            - swift-object
            - memcached
            - tempest

    - name: cp2
      control-plane-prefix: cp2
      uses:
        - from: cp1
          service-components:
            - all
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
#      configuration-data:
#        - OCTAVIA-CONFIG-CP2
#        - NEUTRON-CONFIG-CP2
      common-service-components:
        - lifecycle-manager-target
        - ntp-client

      load-balancers:
        - name: lb
          provider: ip-cluster
          tls-components:
            - default
          components:
            - default
          roles:
            - internal
            - admin

        - name: extlb
          provider: ip-cluster
          external-name: myardana-cp2.test
          cert-file: my-public-cp2-cert
          tls-components:
            - default
          roles:
            - public

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

  disk-models:
  - name: DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /

          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file

          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file

  - name: SWIFT-DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /

          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file

          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file

    device-groups:
      - name: swiftobj
        devices:
          - name: /dev/sdb
          - name: /dev/sdc
          - name: /dev/sdd
          - name: /dev/sde
          - name: /dev/sdf
        consumer:
          name: swift
          attrs:
            rings:
              - account
              - container
              - object-0
0707010000002A000081A40000000000000000000000015C7A0D8A0000051E000000000000000000000000000000000000007400000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model/data/network_groups.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.
#
---
  product:
    version: 2

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

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

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

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

#      routes:
#        - default

      load-balancers:
        - extlb
        - lb

    - name: EXTERNAL-VM
      tags:
        - neutron.l3_agent.external_network_bridge

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

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

#    - name: region2
#      includes:
#        - control-plane: cp1
#          services:
#            - all
#        - control-plane: cp3
#          services:
#            - all

0707010000002C000081A40000000000000000000000015C7A0D8A00000364000000000000000000000000000000000000007200000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model/data/server_roles.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.
#
---
  product:
    version: 2

  server-roles:

    - name: SERVER1-ROLE
      interface-model: NET-INTERFACES
      disk-model: SWIFT-DISKS

    - name: SERVER2-ROLE
      interface-model: NET-INTERFACES
      disk-model: DISKS
0707010000002D000081A40000000000000000000000015C7A0D8A000004E5000000000000000000000000000000000000006D00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model/data/servers.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

  servers:

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

    - id: server2
      ip-addr: 192.168.110.4
      role: SERVER2-ROLE
      server-group: RACK2
      mac-addr: b2:72:8d:ac:7c:6f
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.4
      ilo-password: password
      ilo-user: admin
0707010000002E000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000006700000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model/data/swift0707010000002F000081A40000000000000000000000015C7A0D8A0000060A000000000000000000000000000000000000007800000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift-cp2-glance/input-model/data/swift/swift_config.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development  LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  configuration-data:
    - name: SWIFT-CONFIG-CP1
      services:
        - swift
      data:
        control_plane_rings:
          swift-zones:
            - id: 1
              server-groups:
                - CLOUD
          rings:
            - name: account
              display-name: Account Ring
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3

            - name: container
              display-name: Container Ring
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3

            - name: object-0
              display-name: General
              default: yes
              min-part-hours: 16
              partition-power: 12
              replication-policy:
                replica-count: 3
07070100000030000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift/input-model07070100000031000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000005600000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift/input-model/data07070100000032000081A40000000000000000000000015C7A0D8A000005BB000000000000000000000000000000000000006800000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift/input-model/data/control_plane.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  control-planes:
    - name: ccp
      control-plane-prefix: ccp
      region-name: region1
      failure-zones:
        - AZ1
        - AZ2
        - AZ3

      common-service-components:
        - lifecycle-manager-target

      clusters:
        - name: cluster0
          cluster-prefix: c0
          server-role:
            - SERVER1-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - lifecycle-manager
            - lifecycle-manager-target
            - mysql
            - ip-cluster
            - keystone-api
            - rabbitmq
            - ntp-server
            - swift-ring-builder
            - swift-proxy
            - swift-account
            - swift-container
            - swift-object
            - memcached
07070100000033000081A40000000000000000000000015C7A0D8A00000765000000000000000000000000000000000000006000000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift/input-model/data/disks.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  disk-models:
  - name: DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /

          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file

          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file

    device-groups:
      - name: swiftobj
        devices:
          - name: /dev/sdb
          - name: /dev/sdc
          - name: /dev/sdd
          - name: /dev/sde
          - name: /dev/sdf
        consumer:
          name: swift
          attrs:
            rings:
              - account
              - container
              - object-0
07070100000034000081A40000000000000000000000015C7A0D8A000003F4000000000000000000000000000000000000006200000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift/input-model/data/servers.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

  servers:

    - id: server1
      ip-addr: 192.168.110.3
      role: SERVER1-ROLE
      server-group: AZ1
      mac-addr: a4:93:0c:4f:7c:73
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.3
      ilo-password: password
      ilo-user: admin
07070100000035000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000005C00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift/input-model/data/swift07070100000036000081A40000000000000000000000015C7A0D8A00000561000000000000000000000000000000000000006600000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/cp1-keystone-swift/input-model/data/swift/rings.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.
#
---
product:
    version: 2

ring-specifications:

    - region-name: region1
      swift-zones:
        - id: 1
          server-groups:
            - CLOUD
      rings:
        - name: account
          display-name: Account Ring
          min-part-hours: 16
          partition-power: 12
          replication-policy:
            replica-count: 3

        - name: container
          display-name: Container Ring
          min-part-hours: 16
          partition-power: 12
          replication-policy:
            replica-count: 3

        - name: object-0
          display-name: General
          default: yes
          min-part-hours: 16
          partition-power: 12
          replication-policy:
            replica-count: 3
07070100000037000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000003A00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project07070100000038000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model07070100000039000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000004B00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data0707010000003A000081A40000000000000000000000015C7A0D8A00000943000000000000000000000000000000000000005D00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/control_plane.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.
#
---
  product:
    version: 2

  control-planes:
    - name: cp1
      control-plane-prefix: cp1
      failure-zones:
        - AZ1
        - AZ2
        - AZ3
      configuration-data:
        - SWIFT-CONFIG-CP1
      common-service-components:
        - lifecycle-manager-target
        - monasca-agent

      clusters:

        - name: cluster1
          cluster-prefix: c1
          server-role:
            - SERVER1-ROLE
          member-count: 1
          allocation-policy: strict
          service-components:
            - lifecycle-manager
            - openstack-client
            - ntp-server
            - ntp-client
            - kafka
            - zookeeper
            - vertica
            - spark
            - monasca-api
            - monasca-persister
            - monasca-notifier
            - monasca-threshold
            - openstack-client
            - monasca-transform
            - mysql
            - rabbitmq
            - keystone-api
            - keystone-client
            - ip-cluster
            - tempest
            - swift-client

        - name: cluster2
          cluster-prefix: c2
          server-role:
            - SWPAC-ROLE
          member-count: 3
          allocation-policy: strict
          service-components:
            - ntp-client
            - swift-proxy
            - swift-account
            - swift-container
            - swift-ring-builder
            - swift-client
            - memcached

      resources:
        - name: resource1
          resource-prefix: r1
          server-role:
            - SWOBJ-ROLE
          allocation-policy: strict
          min-count: 3
          service-components:
            - ntp-client
            - swift-object
0707010000003B000081A40000000000000000000000015C7A0D8A00000F4C000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/disks.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2
  disk-models:
  - name: DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /
          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file
          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file
  - name: SWPAC-DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /
          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file
          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file
    device-groups:
      - name: swiftpac
        devices:
          - name: /dev/sdb
          - name: /dev/sdc
          - name: /dev/sdd
          - name: /dev/sde
          - name: /dev/sdf
        consumer:
          name: swift
          attrs:
            rings:
              - account
              - container
  - name: SWOBJ-DISKS
    volume-groups:
      # The policy is not to consume 100% of the space of each volume group.
      # 5% should be left free for snapshots and to allow for some flexibility.
      # sda_root is a templated value to align with whatever partition is really used
      # This value is checked in os config and replaced by the partition actually used
      # on sda e.g. sda1 or sda5
      - name: ardana-vg
        physical-volumes:
         - /dev/sda_root
        logical-volumes:
          - name: root
            size: 75%
            fstype: ext4
            mount: /
          - name: log
            size: 15%
            mount: /var/log
            fstype: ext4
            mkfs-opts: -O large_file
          - name: crash
            size: 2%
            mount: /var/crash
            fstype: ext4
            mkfs-opts: -O large_file
    device-groups:
      - name: swiftobj
        devices:
          - name: /dev/sdb
          - name: /dev/sdc
          - name: /dev/sdd
          - name: /dev/sde
          - name: /dev/sdf
        consumer:
          name: swift
          attrs:
            rings:
              - object-0
              - object-1
0707010000003C000081A40000000000000000000000015C7A0D8A0000089B000000000000000000000000000000000000005E00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/net_interfaces.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.
#
---
  product:
    version: 2

  interface-models:
      # These examples uses hed3 and hed4 as a bonded
      # pair for all networks on all three server roles
      #
      # Edit the device names and bond options
      # to match your environment
      #
    - name: CONTROLLER-INTERFACES
      network-interfaces:
        - name: BOND0
          device:
              name: bond0
          bond-data:
             options:
                 mode: active-backup
                 miimon: 200
                 primary: hed2
             provider: linux
             devices:
               - name: hed2
          network-groups:
            - MANAGEMENT
            - SWIFT
            - SWIFT2

    - name: SWOBJ-INTERFACES
      network-interfaces:
        - name: BOND0
          device:
              name: bond0
          bond-data:
             options:
                 mode: active-backup
                 miimon: 200
                 primary: hed2
             provider: linux
             devices:
               - name: hed2
          network-groups:
            - MANAGEMENT
            - SWIFT
            - SWIFT2

    - name: NET-INTERFACES
      network-interfaces:
        - name: BOND0
          device:
              name: bond0
          bond-data:
             options:
                 mode: active-backup
                 miimon: 200
                 primary: hed2
             provider: linux
             devices:
               - name: hed2
          network-groups:
            - MANAGEMENT
            - SWIFT
            - SWIFT2
0707010000003D000081A40000000000000000000000015C7A0D8A00000832000000000000000000000000000000000000005E00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/network_groups.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

  network-groups:
    #
    # Management
    #
    # This is the network group that will be used to for
    # management traffic within the cloud.
    #
    # The interface used by this group will be presented
    # to Neutron as physnet1, and used by provider VLANS
    #
    #
    - name: MANAGEMENT
      hostname-suffix: mgmt
      hostname: true

      tls-component-endpoints:
        - mysql
      component-endpoints:
        - default

      routes:
        - default

      load-balancers:
        - provider: ip-cluster
          name: lb
          tls-components:
            - default
          components:
            - vertica
            - rabbitmq
          roles:
            - internal
            - admin
          cert-file: ardana-internal-cert

        - provider: ip-cluster
          name: extlb
          external-name: myardana.test
          tls-components:
            - default
          roles:
            - public
          cert-file: my-public-cert


    #
    # SWIFT
    #
    # This is the network group that will be used to for
    # Swift back-end traffic bewtween proxy, container, account
    # and object servers
    #
    - name: SWIFT
      hostname-suffix: swift

      component-endpoints:
        - swift-container
        - swift-account
        - swift-object
        - swift-rsync

    - name: SWIFT2
      hostname-suffix: swift2

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

  networks:
    - name: MANAGEMENT-NET
      vlanid: 100
      tagged-vlan: false
      cidr: 192.168.110.0/24
      gateway-ip: 192.168.110.1
      network-group: MANAGEMENT

    - name: SWIFT-NET
      vlanid: 101
      tagged-vlan: true
      cidr: 192.168.245.0/24
      gateway-ip: 192.168.245.1
      network-group: SWIFT

    - name: SWIFT2-NET
      vlanid: 102
      tagged-vlan: true
      cidr: 192.168.244.0/24
      gateway-ip: 192.168.244.1
      network-group: SWIFT2
0707010000003F000081A40000000000000000000000015C7A0D8A00000310000000000000000000000000000000000000005700000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/regions.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2

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

  server-groups:

    #
    # Server Groups provide a mechanism for organizing servers
    # into a hierarchy that reflected the physical topology.
    #
    # When allocating a server the configuration processor
    # will search down the hierarchy from the list of server
    # groups identified as the failure-zones for the control
    # plane until it finds an available server of the requested
    # role.   If the allocation policy is "strict" servers are
    # allocated from different failure-zones.
    #
    # When determining which network from a network group to
    # associate with a server the configuration processor will
    # search up the hierarchy from the server group containing the
    # server until it finds a network in the required network
    # group.
    #

    #
    # In this example there is only one network in each network
    # group and so we put all networks in the top level server
    # group.   Below this we create server groups for three
    # failure zones, within which servers are grouped by racks.
    #
    # Note: the association of servers to server groups is part
    # of the server definition (servers.yml)
    #

    #
    # At the top of the tree we have a server groups for
    # networks that can reach all servers
    #
    - name: CLOUD
      server-groups:
        - AZ1
        - AZ2
        - AZ3
      networks:
        - MANAGEMENT-NET
        - SWIFT-NET
        - SWIFT2-NET

    #
    # Failure Zones
    #
    - name: AZ1
      server-groups:
        - RACK1

    - name: AZ2
      server-groups:
        - RACK2

    - name: AZ3
      server-groups:
        - RACK3

    #
    # Racks
    #
    - name: RACK1

    - name: RACK2

    - name: RACK3
07070100000041000081A40000000000000000000000015C7A0D8A000003C3000000000000000000000000000000000000005C00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/server_roles.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
  product:
    version: 2
  server-roles:
    - name: SERVER1-ROLE
      interface-model: NET-INTERFACES
      disk-model: DISKS
    - name: SWPAC-ROLE
      interface-model: CONTROLLER-INTERFACES
      disk-model: SWPAC-DISKS
    - name: SWOBJ-ROLE
      interface-model: SWOBJ-INTERFACES
      disk-model: SWOBJ-DISKS
07070100000042000081A40000000000000000000000015C7A0D8A0000097B000000000000000000000000000000000000005700000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/servers.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.
#
---
  product:
    version: 2

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

  servers:

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

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

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

    - id: server4
      ip-addr: 192.168.110.6
      role: SWPAC-ROLE
      server-group: AZ3
      mac-addr: 8a:8e:64:55:44:77
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.6
      ilo-password: password
      ilo-user: admin

    - id: server5
      ip-addr: 192.168.110.7
      role: SWOBJ-ROLE
      server-group: AZ1
      mac-addr: 8a:8e:64:55:42:79
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.7
      ilo-password: password
      ilo-user: admin

    - id: server6
      ip-addr: 192.168.110.8
      role: SWOBJ-ROLE
      server-group: AZ2
      mac-addr: 8a:8e:64:55:46:75
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.8
      ilo-password: password
      ilo-user: admin

    - id: server7
      ip-addr: 192.168.110.9
      role: SWOBJ-ROLE
      server-group: AZ3
      mac-addr: 8a:8e:64:57:41:82
      nic-mapping: VAGRANT
      ilo-ip: 192.168.109.9
      ilo-password: password
      ilo-user: admin
07070100000043000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/swift07070100000044000081A40000000000000000000000015C7A0D8A0000073E000000000000000000000000000000000000006200000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/project/input-model/data/swift/swift_config.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.
#
---
product:
    version: 2

configuration-data:
  - name: SWIFT-CONFIG-CP1
    services:
      - swift
    data:
      control_plane_rings:
        swift-zones:
          - id: 1
            server-groups:
              - CLOUD
        rings:
          - name: account
            display-name: Account Ring
            min-part-hours: 16
            partition-power: 12
            replication-policy:
              replica-count: 3

          - name: container
            display-name: Container Ring
            min-part-hours: 16
            partition-power: 12
            replication-policy:
              replica-count: 3

          - name: object-0
            display-name: General
            default: no
            min-part-hours: 16
            partition-power: 12
            replication-policy:
              replica-count: 3

          - name: object-1
            display-name: Erasure-Code-Ring
            default: yes
            min-part-time: 16
            partition-power: 12
            erasure-coding-policy:
              ec-type: liberasurecode_rs_vand
              ec-num-data-fragments: 10
              ec-num-parity-fragments: 4
              ec-object-segment-size: 1048576
07070100000045000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003800000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/tests07070100000046000081ED0000000000000000000000015C7A0D8A000003D5000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/tests/run-tempest.bash#!/bin/bash
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

set -eux
set -o pipefail

ansible-playbook -i hosts/verb_hosts tempest-test-resources.yml

TEMPBIN=/opt/stack/service/tempest/bin
tempest_script=$TEMPBIN/ardana-tempest.sh

if [[ -x $tempest_script ]]; then
    echo "No tempest script detected!"
    exit 1
fi

sudo -u tempest $tempest_script <<< "+tempest\.api\.object_storage"
07070100000047000081A40000000000000000000000015C7A0D8A00000A2C000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/tests/test-plan.yaml#
# (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: Test that we have a good cloud
  logfile: tempest.log
  prefix: tempest
  exec:
    - validate-swift.bash
  tempest:
    - "+tempest.api.object_storage"

- name: Test reconfigure
  logfile: testsuite-reconfigure.log
  prefix: reconfigure
  playbooks:
    - swift-reconfigure.yml
  exec:
    - validate-swift.bash

- name: Test stop/start of swift
  logfile: stop-start.log
  prefix: stop-start
  playbooks:
    - swift-stop.yml
    - swift-start.yml
  exec:
    - validate-swift.bash

- name: Test swift compare model rings
  logfile: swift-compare-model-rings.log
  prefix: swift-compare-model-rings
  playbooks:
    - swift-compare-model-rings.yml
  exec:
    - validate-swift.bash

- name: Test swift dispersion populate
  logfile: swift-dispersion-populate.log
  prefix: swift-dispersion-populate
  playbooks:
    - swift-dispersion-populate.yml
  exec:
    - validate-swift.bash

- name: Test swift dispersion report
  logfile: swift-dispersion-report.log
  prefix: swift-dispersion-report
  playbooks:
    - swift-dispersion-report.yml
  exec:
    - validate-swift.bash

- name: Test swift reconfigure credentials change
  logfile: swift-reconfigure-credentials-change.log
  prefix: swift-reconfigure-credentials-change
  playbooks:
    - swift-reconfigure-credentials-change.yml
  exec:
    - validate-swift.bash

- name: Test swift upgrade
  logfile: swift-upgrade.log
  prefix: swift-upgrade
  playbooks:
    - swift-upgrade.yml
  exec:
    - validate-swift.bash

- name: Test clusters minus one proxy server
  # can't bring down object node as erasure coding requires at least 11 disks
  logfile: shutdown-nodes.log
  prefix: shutdown-nodes
  vms:
    - shutdown:
        - server4
  tempest:
    - "+tempest.api.object_storage"

- name: Bring up downed server and start services
  logfile: restart-server.log
  prefix: restart-server
  vms:
    - start:
        - server4
  playbooks:
    - swift-start.yml
  exec:
    - validate-swift.bash
07070100000048000081ED0000000000000000000000015C7A0D8A000002C3000000000000000000000000000000000000004C00000000ardana-swift-8.0+git.1551502730.f4d219d/ardana-ci/tests/validate-swift.bash#!/bin/bash
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#


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

# The following relative symlinks are created under the
# my_cloud/config directory.
---
symlinks:
  "swift/proxy-server.conf.j2": "roles/SWF-PRX/templates/proxy-server.conf.j2"
  "swift/account-server.conf.j2": "roles/SWF-ACC/templates/account-server.conf.j2"
  "swift/container-server.conf.j2": "roles/SWF-CON/templates/container-server.conf.j2"
  "swift/container-reconciler.conf.j2": "roles/SWF-CON/templates/container-reconciler.conf.j2"
  "swift/container-sync-realms.conf.j2": "roles/SWF-CON/templates/container-sync-realms.conf.j2"
  "swift/object-server.conf.j2": "roles/SWF-OBJ/templates/object-server.conf.j2"
  "swift/object-expirer.conf.j2": "roles/SWF-EXP/templates/object-expirer.conf.j2"
  "swift/swift-recon.j2": "roles/SWF-OBJ/templates/swift-recon.j2"
  "swift/rsyncd.conf.j2": "roles/_SWF-RSY/templates/rsyncd.conf.j2"
  "swift/swift.conf.j2": "roles/_SWF-CMN/templates/swift.conf.j2"
  "swift/memcache.conf.j2": "roles/_SWF-CMN/templates/memcache.conf.j2"
0707010000004B000041ED0000000000000000000000125C7A0D8A00000000000000000000000000000000000000000000002E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles0707010000004C000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000003600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC0707010000004D000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/defaults0707010000004E000081A40000000000000000000000015C7A0D8A0000079F000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/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.
#
---
swift_component: swift_account

# Flag to track restart requirement
swift_account_reload_required: false
swift_account_restart_required: false

# Default max number of open files the swift account processes can use
swift_account_limit_open_files: 65536

# Default service directories
swift_account_server_conf_dir: "{{ 'swift-account-server' | config_dir() }}"

# cmd          Identifies the name of the binary used when starting the service
# conf         Specifies the name of the conf file to pass on the cmd line
#              when starting the service
# conf_service Specifies the name of the service that contains the conf file
# main         Identifies the "main" swift services. It is currently not used.
swift_account_services:
  swift-account-server:
    cmd: swift-account-server
    conf: account-server.conf
    conf_service: swift-account-server
    main: true
  swift-account-auditor:
    cmd: swift-account-auditor
    conf: account-server.conf
    conf_service: swift-account-server
    main: false
  swift-account-reaper:
    cmd: swift-account-reaper
    conf: account-server.conf
    conf_service: swift-account-server
    main: false
  swift-account-replicator:
    cmd: swift-account-replicator
    conf: account-server.conf
    conf_service: swift-account-server
    main: false
0707010000004F000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/handlers07070100000050000081A40000000000000000000000015C7A0D8A00000334000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swift_account_config_change
  set_fact:
    swift_account_reload_required: true

- name: swift_account_venv_change
  set_fact:
    swift_account_restart_required: true
07070100000051000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/meta07070100000052000081A40000000000000000000000015C7A0D8A000002B7000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/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: _SWF-CMN
  - role: _SWF-RSY
07070100000053000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/tasks07070100000054000081A40000000000000000000000015C7A0D8A00000770000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/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.
#
---
- include: ../../_SWF-CMN/tasks/configure.yml

- set_fact:
    swift_account_server_role: true

- name: SWF-ACC | configure | Create swift_devices directory
  file:
    path: "{{ swift_devices }}"
    owner: root
    group: root
    mode: 0755
    state: directory

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: SWF-ACC | configure | Enable the swift account services to start on boot
  command: systemctl reenable "{{ item.key }}"
  with_dict: "{{ swift_account_services }}"

# Note, this .conf file should NOT be in the service specific etc dir
- name: SWF-ACC | configure | Copy swift.conf
  template:
    src: ../../_SWF-CMN/templates/swift.conf.j2
    dest: "{{ swift_dir }}/swift.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_config_change

- name: SWF-ACC | configure | Copy account-server.conf
  template:
    src: account-server.conf.j2
    dest: "{{ swift_account_server_conf_dir }}/account-server.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_account_config_change

- include: ../../_SWF-CMN/tasks/provision_storage.yml
07070100000055000081A40000000000000000000000015C7A0D8A0000098E000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/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.
#
---
- include: ../../_SWF-CMN/tasks/install.yml

- name: SWF-ACC | install | Update venv cache
  become: yes
  install_package:
    cache: update

- name: SWF-ACC | install | Install Swift Account services
  install_package:
    name: swift
    service: "{{ item.key }}"
    state: present
    activate: act_off
  with_dict: "{{ swift_account_services }}"
  register: swift_account_install_result
  notify: swift_account_venv_change

# See swift-ansible/README for a description of the result structure
# returned by the install_package module

# Get the swift venv version, it is the same for all swift services.
- name: SWF-ACC | install | Set conf directory for the service
  set_fact:
    swift_venv_version: "{{ item.version }}"
  with_items: "{{ swift_account_install_result.results }}"

# Since all swift account services are in the one swift venv just set one fact,
# swift_account_server_conf_dir for all the swift_account_services
- name: SWF-ACC | install | Set conf directory for the service
  set_fact:
    swift_account_server_conf_dir: "{{ 'swift-account-server' | config_dir(item.version) }}"
  with_items: "{{ swift_account_install_result.results }}"

# Note all swift account services use the same configuration file,
# account-server.conf which is located in the conf_dir for swift-account-server
# service
- name: SWF-ACC | install | Register the Swift Account services
  setup_systemd:
    service: "{{ item.item.key }}"
    cmd: "{{ item.item.value.cmd }}"
    user: "{{ swift_user }}"
    group: "{{ swift_group }}"
    args: "{{ item.item.value.conf_service |
          config_dir(swift_venv_version) }}/{{ item.item.value.conf }}"
    limit_open_files: "{{ swift_account_limit_open_files }}"
  when: item.changed
  with_items: "{{ swift_account_install_result.results }}"
07070100000056000081A40000000000000000000000015C7A0D8A0000039E000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/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: SWF-ACC | local_monitor | Setup active check on the Account Server locally
  become: yes
  monasca_agent_plugin:
    name: "httpcheck"
    args: "url=http://{{ account_bind_ip }}:{{ account_bind_port }}/healthcheck dimensions=service:object-storage,component:account-server"
07070100000057000081A40000000000000000000000015C7A0D8A00000835000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/tasks/start.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/_check_restart.yml

- name: SWF-ACC | start | Activate the latest install
  install_package:
    name: swift
    service: "{{ item.item.key }}"
    activate: act_on
    version: "{{ item.version }}"
  with_items: swift_account_install_result.results
  when: swift_account_install_result is defined

- name: SWF-ACC | start | Restart rsyslog
  service:
    name: rsyslog
    state: restarted
  when: ardana_notify_swift_common_rsyslog_restart_required is defined and
        ardana_notify_swift_common_rsyslog_restart_required.changed and
        swift_common_rsyslog_restarted is not defined
  register: swift_common_rsyslog_restarted

# For now restart rather than reload
# No need to restart here if swift-account restart is also happening
- name: SWF-ACC | start | Reload the Swift Account services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_account_services }}"
  when: swift_account_reload_required and (not swift_restart_required) and
        (not swift_account_restart_required)

- name: SWF-ACC | start | Restart the Swift Account services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_account_services }}"
  when: swift_restart_required or swift_account_restart_required

- name: SWF-ACC | start | Start the Swift Account services
  service:
    name: "{{ item.key }}"
    state: started
  with_dict: "{{ swift_account_services }}"
07070100000058000081A40000000000000000000000015C7A0D8A000002B8000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/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: ../../_SWF-CMN/tasks/_service_status.yml
07070100000059000081A40000000000000000000000015C7A0D8A00000327000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/tasks/stop.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: SWF-ACC | stop | Stop the Swift Account services
  service:
    name: "{{ item.key }}"
    state: stopped
  with_dict: "{{ swift_account_services }}"
0707010000005A000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/templates0707010000005B000081A40000000000000000000000015C7A0D8A0000060C000000000000000000000000000000000000005700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-ACC/templates/account-server.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 OpenStack values that apply only to the Swift 
# service.
# You may make changes to this file by adding sections/options below.
[DEFAULT]
bind_ip = {{ account_bind_ip }}
bind_port = {{ account_bind_port }}
mount_check = {{ mount_check }}
devices = {{ swift_devices }}
workers = {{ swift_worker_count }}

[pipeline:main]
pipeline = healthcheck recon account-server

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:recon]
use = egg:swift#recon
recon_cache_path = {{ recon_cache_path }}

[app:account-server]
use = egg:swift#account
# TODO setting the reserved space small for now.
fallocate_reserve = 1099511627

[filter:xprofile]
use = egg:swift#xprofile

[account-auditor]
recon_cache_path = {{ recon_cache_path }}

[account-reaper]
delay_reaping = 604800

[account-replicator]
recon_cache_path = {{ recon_cache_path }}

## Do NOT put anything after this line ##
0707010000005C000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000003600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON0707010000005D000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/defaults0707010000005E000081A40000000000000000000000015C7A0D8A00000A16000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/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.
#
---

swift_component: swift_container

# Flag to track restart requirement
swift_container_restart_required: false
swift_container_reload_required: false
swift_container_reconciler_reload_required: false
swift_container_sync_reload_required: false

# Default service directories
swift_container_server_conf_dir: "{{ 'swift-container-server' | config_dir() }}"
swift_container_reconciler_conf_dir: "{{ 'swift-container-reconciler' | config_dir() }}"

# cmd          Identifies the name of the binary used when starting the service
# conf         Specifies the name of the conf file to pass on the cmd line
#              when starting the service
# conf_service Specifies the name of the service that contains the conf file
# main         Identifies the "main" swift services. It is currently not used.
swift_container_services:
  swift-container-server:
    cmd: swift-container-server
    conf: container-server.conf
    conf_service: swift-container-server
    main: true
  swift-container-auditor:
    cmd: swift-container-auditor
    conf: container-server.conf
    conf_service: swift-container-server
    main: false
  swift-container-reconciler:
    cmd: swift-container-reconciler
    conf: container-reconciler.conf
    conf_service: swift-container-reconciler
    main: false
  swift-container-sync:
    cmd: swift-container-sync
    conf: container-server.conf
    conf_service: swift-container-server
    main: false
  swift-container-replicator:
    cmd: swift-container-replicator
    conf: container-server.conf
    conf_service: swift-container-server
    main: false
  swift-container-updater:
    cmd: swift-container-updater
    conf: container-server.conf
    conf_service: swift-container-server
    main: false

# Values needed for container sync intra-cluster realm
swift_intracluster_sync_key: "{{ SWF_CON.vars.swift_intracluster_sync_key }}"
swift_internal_endpoint: "{{ SWF_PRX.advertises.vips.private[0].url }}/v1/"
0707010000005F000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/handlers07070100000060000081A40000000000000000000000015C7A0D8A00000416000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swift_container_config_change
  set_fact:
    swift_container_reload_required: true

- name: swift_container_reconciler_config_change
  set_fact:
    swift_container_reconciler_reload_required: true

- name: swift_container_sync_config_change
  set_fact:
    swift_container_sync_reload_required: true

- name: swift_container_venv_change
  set_fact:
    swift_container_restart_required: true
07070100000061000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/meta07070100000062000081A40000000000000000000000015C7A0D8A000002B7000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/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: _SWF-CMN
  - role: _SWF-RSY
07070100000063000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/tasks07070100000064000081A40000000000000000000000015C7A0D8A00000A44000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/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.
#
---
- include: ../../_SWF-CMN/tasks/configure.yml

- set_fact:
    swift_container_server_role: true

- name: SWF-CON | configure | Create swift_devices directory
  file:
    path: "{{ swift_devices }}"
    owner: root
    group: root
    mode: 0755
    state: directory

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: SWF-CON | configure | Enable the container object services to start on boot
  command: systemctl reenable {{ item.key }}
  with_dict: "{{ swift_container_services }}"

# Note, swift.conf file should NOT be in the service specific etc dir
- name: SWF-CON | configure | Copy swift.conf
  template:
    src: ../../_SWF-CMN/templates/swift.conf.j2
    dest: "{{ swift_dir }}/swift.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_config_change

- name: SWF-CON | configure | Copy container-server.conf
  template:
    src: container-server.conf.j2
    dest: "{{ swift_container_server_conf_dir }}/container-server.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_container_config_change

- name: SWF-CON | configure | Copy container-reconciler.conf
  template:
    src: container-reconciler.conf.j2
    dest: "{{ swift_container_reconciler_conf_dir }}/container-reconciler.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_container_reconciler_config_change

# Note, container-sync-realms.conf file should NOT be in the service specific
# etc dir
- name: SWF-CON | configure | Copy container-sync-realms.conf
  template:
    src: container-sync-realms.conf.j2
    dest: "{{ swift_dir }}/container-sync-realms.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_container_sync_config_change

- include: ../../_SWF-CMN/tasks/provision_storage.yml
07070100000065000081A40000000000000000000000015C7A0D8A000009A7000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/tasks/install.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/install.yml

- name: SWF-CON | install | Update venv cache
  become: yes
  install_package:
    cache: update

- name: SWF-CON | install | Install Swift Container services
  install_package:
    name: swift
    service: "{{ item.key }}"
    state: present
    activate: act_off
  with_dict: "{{ swift_container_services }}"
  register: swift_container_install_result
  notify: swift_container_venv_change

# See swift-ansible/README for a description of the result structure
# returned by the install_package module

# Get the swift venv version, it is the same for all swift services.
- name: SWF-CON | install | Set conf directory for the service
  set_fact:
    swift_venv_version: "{{ item.version }}"
  with_items: "{{ swift_container_install_result.results }}"

# Set the conf dir for the latest installed swift venv
- set_fact:
    swift_container_server_conf_dir: "{{ 'swift-container-server' |
      config_dir(swift_venv_version) }}"
    swift_container_reconciler_conf_dir: "{{ 'swift-container-reconciler' |
      config_dir(swift_venv_version) }}"

# All swift container services except the reconciler use the same
# configuration file, container-server.conf which is located in the
# swift-contaier-server service etc directory. The conf_service value
# in the result identifies which service has the conf file and
# value.conf identifies the conf file to use
- name: SWF-CON | install | Register the Swift Container Server
  setup_systemd:
    service: "{{ item.item.key }}"
    cmd: "{{ item.item.value.cmd }}"
    user: "{{ swift_user }}"
    group: "{{ swift_group }}"
    args: "{{ item.item.value.conf_service |
          config_dir(swift_venv_version) }}/{{ item.item.value.conf }}"
  when: item.changed
  with_items: "{{ swift_container_install_result.results }}"
07070100000066000081A40000000000000000000000015C7A0D8A000003A6000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/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: SWF-CON | local_monitor | Setup active check on the Container Server locally
  become: yes
  monasca_agent_plugin:
    name: "httpcheck"
    args: "url=http://{{ container_bind_ip }}:{{ container_bind_port }}/healthcheck dimensions=service:object-storage,component:container-server"
07070100000067000081A40000000000000000000000015C7A0D8A00000283000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/tasks/populate.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.
#
---
07070100000068000081A40000000000000000000000015C7A0D8A00000B47000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/tasks/start.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/_check_restart.yml

- name: SWF-CON | start | Activate the latest install
  install_package:
    name: swift
    service: "{{ item.item.key }}"
    activate: act_on
    version: "{{ item.version }}"
  with_items: swift_container_install_result.results
  when: swift_container_install_result is defined

- name: SWF-CON | start | Restart rsyslog
  service:
    name: rsyslog
    state: restarted
  when: ardana_notify_swift_common_rsyslog_restart_required is defined and
        ardana_notify_swift_common_rsyslog_restart_required.changed and
        swift_common_rsyslog_restarted is not defined
  register: swift_common_rsyslog_restarted

# For now restart rather than reload
# No need to restart here if swift-container restart is also happening
- name: SWF-CON | start | Reload the Swift Container services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_container_services }}"
  when: swift_container_reload_required and (not swift_restart_required) and
        (not swift_container_restart_required)

- name: SWF-CON | start | Restart the Swift Container services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_container_services }}"
  when: swift_restart_required or swift_container_restart_required

# No need to restart here if swift-container restart is also happening
- name: SWF-CON | start | Reload the Swift Container Reconciler
  service:
    name: swift-container-reconciler
    state: restarted
  when: swift_container_reconciler_reload_required and
        (not swift_container_reload_required) and (not swift_restart_required) and
        (not swift_container_restart_required)

# No need to restart here if swift-container restart is also happening
- name: SWF-CON | start | Reload the Swift Container Sync
  service:
    name: swift-container-sync
    state: restarted
  when: swift_container_sync_reload_required and
        (not swift_container_reload_required) and (not swift_restart_required) and
        (not swift_container_restart_required)

- name: SWF-CON | start | Start the Swift Container services
  service:
    name: "{{ item.key }}"
    state: started
  with_dict: "{{ swift_container_services }}"
07070100000069000081A40000000000000000000000015C7A0D8A000002B8000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/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: ../../_SWF-CMN/tasks/_service_status.yml
0707010000006A000081A40000000000000000000000015C7A0D8A0000032C000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/tasks/stop.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---


- name: SWF-CON | stop | Stop the Swift Container services
  service:
    name: "{{ item.key }}"
    state: stopped
  with_dict: "{{ swift_container_services }}"
0707010000006B000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/templates0707010000006C000081A40000000000000000000000015C7A0D8A00000475000000000000000000000000000000000000005D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/templates/container-reconciler.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 Swift 
# service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]

[container-reconciler]

[pipeline:main]
pipeline = catch_errors proxy-logging cache proxy-server

[app:proxy-server]
use = egg:swift#proxy

[filter:cache]
use = egg:swift#memcache

[filter:proxy-logging]
use = egg:swift#proxy_logging

[filter:catch_errors]
use = egg:swift#catch_errors

## Do NOT put anything after this line ##
0707010000006D000081A40000000000000000000000015C7A0D8A0000065B000000000000000000000000000000000000005900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/templates/container-server.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 OpenStack values that apply only to the Swift 
# service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
bind_ip = {{ container_bind_ip }}
bind_port = {{ container_bind_port }}
mount_check = {{ mount_check }}
devices = {{ swift_devices }}
workers = {{ swift_worker_count }}

[pipeline:main]
pipeline = healthcheck recon container-server

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:recon]
use = egg:swift#recon
recon_cache_path = {{ recon_cache_path }}

[app:container-server]
use = egg:swift#container
allow_versions = true
# TODO setting the reserved space small for now.
fallocate_reserve = 1099511627

[filter:xprofile]
use = egg:swift#xprofile

[container-auditor]
recon_cache_path = {{ recon_cache_path }}

[container-replicator]
recon_cache_path = {{ recon_cache_path }}

[container-updater]
recon_cache_path = {{ recon_cache_path }}

[container-sync]

## Do NOT put anything after this line ##
0707010000006E000081A40000000000000000000000015C7A0D8A00000A5B000000000000000000000000000000000000005E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-CON/templates/container-sync-realms.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 Swift 
# service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
mtime_check_interval = 300

# The intracluster realm facilitates syncing containers on this system
[intracluster]
key = {{ swift_intracluster_sync_key }}
# key2 =
cluster_thiscluster = {{ swift_internal_endpoint }}

#Add sync realms here, for example:
# [realm1]
# key = realm1key
# key2 = realm1key2
# cluster_name1 = https://host1/v1/
# cluster_name2 = https://host2/v1/

# Each section name is the name of a sync realm. A sync realm is a set of
# clusters that have agreed to allow container syncing with each other. Realm
# names will be considered case insensitive.
#
# The key is the overall cluster-to-cluster key used in combination with the
# external users' key that they set on their containers' X-Container-Sync-Key
# metadata header values. These keys will be used to sign each request the
# container sync daemon makes and used to validate each incoming container sync
# request.
#
# The key2 is optional and is an additional key incoming requests will be
# checked against. This is so you can rotate keys if you wish; you move the
# existing key to key2 and make a new key value.
#
# Any values in the realm section whose names begin with cluster_ will indicate
# the name and endpoint of a cluster and will be used by external users in
# their containers' X-Container-Sync-To metadata header values with the format
# "realm_name/cluster_name/container_name". Realm and cluster names are
# considered case insensitive.
#
# The endpoint is what the container sync daemon will use when sending out
# requests to that cluster. Keep in mind this endpoint must be reachable by all
# container servers, since that is where the container sync daemon runs. Note
# the the endpoint ends with /v1/ and that the container sync daemon will then
# add the account/container/obj name after that.

## Do NOT put anything after this line ##
0707010000006F000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000003600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP07070100000070000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/defaults07070100000071000081A40000000000000000000000015C7A0D8A0000041C000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/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.
#
---

swift_component: swift_expirer

# Flag to track restart requirement
swift_expirer_reload_required: false
swift_expirer_restart_required: false

# Default service directories
swift_expirer_conf_dir: "{{ 'swift-object-expirer' | config_dir() }}"

swift_expirer_services:
  swift-object-expirer:
    cmd: swift-object-expirer
    conf: object-expirer.conf
    conf_service: swift-object-expirer
    main: false
07070100000072000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/handlers07070100000073000081A40000000000000000000000015C7A0D8A00000334000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swift_expirer_config_change
  set_fact:
    swift_expirer_reload_required: true

- name: swift_expirer_venv_change
  set_fact:
    swift_expirer_restart_required: true
07070100000074000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/meta07070100000075000081A40000000000000000000000015C7A0D8A000002A4000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/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: _SWF-CMN
07070100000076000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/tasks07070100000077000081A40000000000000000000000015C7A0D8A000004E1000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/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.
#
---

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: SWF-EXP | configure | Enable the swift expirer services to start on boot
  command: systemctl reenable "{{ item.key }}"
  with_dict: "{{ swift_expirer_services }}"

- name: SWF-EXP | configure | Copy object-expirer.conf
  template:
    src: object-expirer.conf.j2
    dest: "{{ swift_expirer_conf_dir }}/object-expirer.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_expirer_config_change
07070100000078000081A40000000000000000000000015C7A0D8A0000088F000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/tasks/install.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: SWF-EXP | install | Update venv cache
  become: yes
  install_package:
    cache: update

- name: SWF-EXP | install | Install Swift Expirer services
  install_package:
    name: swift
    service: "{{ item.key }}"
    state: present
    activate: act_off
  with_dict: "{{ swift_expirer_services }}"
  register: swift_expirer_install_result
  notify: swift_expirer_venv_change

# See swift-ansible/README for a description of the result structure
# returned by the install_package module

# Get the swift venv version, it is the same for all swift services.
- name: SWF-EXP | install | Set conf directory for the service
  set_fact:
    swift_venv_version: "{{ item.version }}"
  with_items: "{{ swift_expirer_install_result.results }}"

# Since all swift object expirer services are in the one swift venv just set
# one fact, swift_object_expirer_conf_dir for all the swift_object_expirer_services
- name: SWF-EXP | install | Set conf directory for the service
  set_fact:
    swift_expirer_conf_dir: "{{ 'swift-object-expirer' | config_dir(item.version) }}"
  with_items: "{{ swift_expirer_install_result.results }}"

- name: SWF-EXP | install | Register the Swift Expirer services
  setup_systemd:
    service: "{{ item.item.key }}"
    cmd: "{{ item.item.value.cmd }}"
    user: "{{ swift_user }}"
    group: "{{ swift_group }}"
    args: "{{ item.item.value.conf_service |
          config_dir(swift_venv_version) }}/{{ item.item.value.conf }}"
  when: item.changed
  with_items: "{{ swift_expirer_install_result.results }}"
07070100000079000081A40000000000000000000000015C7A0D8A00000704000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/tasks/start.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/_check_restart.yml

- name: SWF-EXP | start | Activate the latest install
  install_package:
    name: swift
    service: "{{ item.item.key }}"
    activate: act_on
    version: "{{ item.version }}"
  with_items: swift_expirer_install_result.results
  when: swift_expirer_install_result is defined

# For now restart rather than reload
# Skip if a restart is required
# No need to restart here if swift-expirer restart is also happening
- name: SWF-EXP | start | Reload the Swift Expirer services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_expirer_services }}"
  when: swift_expirer_reload_required and (not swift_restart_required) and
        (not swift_expirer_restart_required)

- name: SWF-EXP | start | Restart the Swift Expirer services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_expirer_services }}"
  when: swift_restart_required or swift_expirer_restart_required

- name: SWF-EXP | start | Start the Swift Expirer services
  service:
    name: "{{ item.key }}"
    state: started
  with_dict: "{{ swift_expirer_services }}"
0707010000007A000081A40000000000000000000000015C7A0D8A000002B8000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/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: ../../_SWF-CMN/tasks/_service_status.yml
0707010000007B000081A40000000000000000000000015C7A0D8A00000327000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/tasks/stop.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: SWF-EXP | stop | Stop the Swift Expirer services
  service:
    name: "{{ item.key }}"
    state: stopped
  with_dict: "{{ swift_expirer_services }}"
0707010000007C000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/templates0707010000007D000081A40000000000000000000000015C7A0D8A000004A3000000000000000000000000000000000000005700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-EXP/templates/object-expirer.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 Swift 
# service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
swift_dir = {{ swift_dir }}
user = {{ swift_user }}

[object-expirer]

[pipeline:main]
pipeline = catch_errors proxy-logging cache proxy-server

[app:proxy-server]
use = egg:swift#proxy

[filter:cache]
use = egg:swift#memcache

[filter:catch_errors]
use = egg:swift#catch_errors

[filter:proxy-logging]
use = egg:swift#proxy_logging

## Do NOT put anything after this line ##
0707010000007E000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000003600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ0707010000007F000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/defaults07070100000080000081A40000000000000000000000015C7A0D8A00000838000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/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.
#
---

swift_component: swift_object

# Flag to track restart requirement
swift_object_reload_required: false
swift_object_restart_required: false

# Default service directories
swift_object_server_conf_dir: "{{ 'swift-object-server' | config_dir() }}"

# Default max number of open files the swift object processes can use
swift_object_limit_open_files: 65536

# The main key/value in the swift_object_services dict is currently
# not used. The intention is in the future to handle what are
# considered main swift services differently e.g. sending them
# a SIGHUP when shutting them down to allow worker processes to
# complete inflight transactions.
swift_object_services:
  swift-object-server:
    cmd: swift-object-server
    conf: object-server.conf
    conf_service: swift-object-server
    main: true
  swift-object-auditor:
    cmd: swift-object-auditor
    conf: object-server.conf
    conf_service: swift-object-server
    main: false
  swift-object-updater:
    cmd: swift-object-updater
    conf: object-server.conf
    conf_service: swift-object-server
    main: false
  swift-object-replicator:
    cmd: swift-object-replicator
    conf: object-server.conf
    conf_service: swift-object-server
    main: false
  swift-object-reconstructor:
    cmd: swift-object-reconstructor
    conf: object-server.conf
    conf_service: swift-object-server
    main: false
  # The object expirer is not included, instead it is handled by the
  # SWF-EXP role
07070100000081000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/handlers07070100000082000081A40000000000000000000000015C7A0D8A00000330000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swift_object_config_change
  set_fact:
    swift_object_reload_required: true

- name: swift_object_venv_change
  set_fact:
    swift_object_restart_required: true
07070100000083000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/meta07070100000084000081A40000000000000000000000015C7A0D8A000002B7000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/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: _SWF-CMN
  - role: _SWF-RSY
07070100000085000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/tasks07070100000086000081A40000000000000000000000015C7A0D8A00000819000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/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.
#
---
- include: ../../_SWF-CMN/tasks/configure.yml

- set_fact:
    swift_object_server_role: true

- name: SWF-OBJ | configure | Create swift_devices directory
  file:
    path: "{{ swift_devices }}"
    owner: root
    group: root
    mode: 0755
    state: directory

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: SWF-OBJ | configure | Enable the swift object services to start on boot
  command: systemctl reenable "{{ item.key }}"
  with_dict: "{{ swift_object_services }}"

# Note, this .conf file should NOT be in the service specific etc dir
- name: SWF-OBJ | configure | Copy swift.conf
  template:
    src: ../../_SWF-CMN/templates/swift.conf.j2
    dest: "{{ swift_dir }}/swift.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_config_change

- name: SWF-OBJ | configure | Copy object-server.conf
  template:
    src: object-server.conf.j2
    dest: "{{ swift_object_server_conf_dir }}/object-server.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_object_config_change

- name: SWF-OBJ | configure | Copy /etc/cron.d/swift-recon
  template:
    src: swift-recon.j2
    dest: /etc/cron.d/swift-recon
    owner: root
    group: root
    mode: 0644

- include: ../../_SWF-CMN/tasks/provision_storage.yml
07070100000087000081A40000000000000000000000015C7A0D8A00000938000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/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.
#
---
- include: ../../_SWF-CMN/tasks/install.yml

- name: SWF-OBJ | install | Update venv cache
  become: yes
  install_package:
    cache: update

- name: SWF-OBJ | install | Install Swift Object services
  install_package:
    name: swift
    service: "{{ item.key }}"
    state: present
    activate: act_off
  with_dict: "{{ swift_object_services }}"
  register: swift_object_install_result
  notify: swift_object_venv_change

# See swift-ansible/README for a description of the result structure
# returned by the install_package module

- name: SWF-OBJ | install | Set conf directory for the service
  set_fact:
    swift_venv_version: "{{ item.version }}"
  with_items: "{{ swift_object_install_result.results }}"

# Since all swift object services are in the one swift venv just set one fact,
# swift_object_server_conf_dir for all the swift_object_services
- name: SWF-OBJ | install | Set conf directory for the service
  set_fact:
    swift_object_server_conf_dir: "{{ 'swift-object-server' | config_dir(item.version) }}"
  with_items: "{{ swift_object_install_result.results }}"

# Note all swift object services use the same configuration file,
# object-server.conf which is located in the conf_dir for swift-object-server
# service
- name: SWF-OBJ | install | Register the Swift Object services
  setup_systemd:
    service: "{{ item.item.key }}"
    cmd: "{{ item.item.value.cmd }}"
    user: "{{ swift_user }}"
    group: "{{ swift_group }}"
    args: "{{ item.item.value.conf_service |
          config_dir(swift_venv_version) }}/{{ item.item.value.conf }}"
    limit_open_files: "{{ swift_object_limit_open_files }}"
  when: item.changed
  with_items: "{{ swift_object_install_result.results }}"
07070100000088000081A40000000000000000000000015C7A0D8A0000039A000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/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: SWF-OBJ | local_monitor | Setup active check on the Object Server locally
  become: yes
  monasca_agent_plugin:
    name: "httpcheck"
    args: "url=http://{{ object_bind_ip }}:{{ object_bind_port }}/healthcheck dimensions=service:object-storage,component:object-server"
07070100000089000081A40000000000000000000000015C7A0D8A00000283000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/tasks/populate.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.
#
---
0707010000008A000081A40000000000000000000000015C7A0D8A0000082A000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/tasks/start.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/_check_restart.yml

- name: SWF-OBJ | start | Activate the latest install
  install_package:
    name: swift
    service: "{{ item.item.key }}"
    activate: act_on
    version: "{{ item.version }}"
  with_items: swift_object_install_result.results
  when: swift_object_install_result is defined


- name: SWF-OBJ | start | Restart rsyslog
  service:
    name: rsyslog
    state: restarted
  when: ardana_notify_swift_common_rsyslog_restart_required is defined and
        ardana_notify_swift_common_rsyslog_restart_required.changed and
        swift_common_rsyslog_restarted is not defined
  register: swift_common_rsyslog_restarted

# For now restart rather than reload
# No need to restart here if swift-object restart is also happening
- name: SWF-OBJ | start | Reload the Swift Object services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_object_services }}"
  when: swift_object_reload_required and (not swift_restart_required) and
        (not swift_object_restart_required)

- name: SWF-OBJ | start | Restart the Swift Object services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_object_services }}"
  when: swift_restart_required or swift_object_restart_required

- name: SWF-OBJ | start | Start the Swift Object services
  service:
    name: "{{ item.key }}"
    state: started
  with_dict: "{{ swift_object_services }}"
0707010000008B000081A40000000000000000000000015C7A0D8A000002B8000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/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: ../../_SWF-CMN/tasks/_service_status.yml
0707010000008C000081A40000000000000000000000015C7A0D8A00000325000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/tasks/stop.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: SWF-OBJ | stop | Stop the Swift Object services
  service:
    name: "{{ item.key }}"
    state: stopped
  with_dict: "{{ swift_object_services }}"
0707010000008D000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/templates0707010000008E000081A40000000000000000000000015C7A0D8A0000071A000000000000000000000000000000000000005600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/templates/object-server.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 OpenStack values that apply only to the Swift 
# service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
bind_ip = {{ object_bind_ip }}
{% if ',' in object_bind_port %}
bind_port = {{ object_bind_port.split(',')[0] }}
{% elif ':' in object_bind_port %}
bind_port = {{ object_bind_port.split(':')[0] }}
{% else %}
bind_port = {{ object_bind_port }}
{% endif %}
mount_check = {{ mount_check }}
devices = {{ swift_devices }}
workers = {{ swift_worker_count }}

[pipeline:main]
pipeline = healthcheck recon object-server

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:recon]
use = egg:swift#recon
recon_cache_path = {{ recon_cache_path }}

[app:object-server]
use = egg:swift#object
# TODO setting the reserved space small for now.
fallocate_reserve = 1099511627

[filter:xprofile]
use = egg:swift#xprofile

[object-auditor]
recon_cache_path = {{ recon_cache_path }}

[object-replicator]
recon_cache_path = {{ recon_cache_path }}

[object-reconstructor]
recon_cache_path = {{ recon_cache_path }}

[object-updater]
recon_cache_path = {{ recon_cache_path }}

## Do NOT put anything after this line ##
0707010000008F000081A40000000000000000000000015C7A0D8A00000373000000000000000000000000000000000000004F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-OBJ/templates/swift-recon.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.
#
#}
# Cronjob to track async pending on the object server.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
*/5 * * * * {{ swift_user }} swift-recon-cron {{ swift_object_conf_dir }}/object-server.conf
07070100000090000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000003600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX07070100000091000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/defaults07070100000092000081A40000000000000000000000015C7A0D8A000005DC000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/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.
#
---
swift_component: swift_proxy

# Flag to track restart requirement
swift_proxy_reload_required: false
swift_proxy_restart_required: false

# Default max number of open files the swift proxy processes can use
swift_proxy_limit_open_files: 65536

# Default service directories
swift_proxy_server_conf_dir: "{{ 'swift-proxy-server' | config_dir() }}"

# cmd          Identifies the name of the binary used when starting the service
# conf         Specifies the name of the conf file to pass on the cmd line
#              when starting the service
# conf_service Specifies the name of the service that contains the conf file
# main         Identifies the "main" swift services. It is currently not used.
swift_proxy_services:
  swift-proxy-server:
    cmd: swift-proxy-server
    conf: proxy-server.conf
    conf_service: swift-proxy-server
    main: true
07070100000093000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/handlers07070100000094000081A40000000000000000000000015C7A0D8A0000032C000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swift_proxy_config_change
  set_fact:
    swift_proxy_reload_required: true

- name: swift_proxy_venv_change
  set_fact:
    swift_proxy_restart_required: true
07070100000095000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/meta07070100000096000081A40000000000000000000000015C7A0D8A000002A4000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/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: _SWF-CMN
07070100000097000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/tasks07070100000098000081A40000000000000000000000015C7A0D8A000008CE000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/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.
#
---
- include: ../../_SWF-CMN/tasks/configure.yml

- set_fact:
    swift_proxy_server_role: true

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: SWF-PRX | configure | Enable the swift proxy services to start on boot
  command: systemctl reenable "{{ item.key }}"
  with_dict: "{{ swift_proxy_services }}"

# Note, this .conf file should NOT be in a venv specific etc dir
- name: SWF-PRX | configure | Copy swift.conf
  template:
    src: ../../_SWF-CMN/templates/swift.conf.j2
    dest: "{{ swift_dir }}/swift.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_config_change

- name: SWF-PRX | configure | Copy proxy-server.conf to service specific etc
  template:
    src: proxy-server.conf.j2
    dest: "{{ swift_proxy_server_conf_dir }}/proxy-server.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_proxy_config_change

- name: SWF-PRX | configure | Create auditing logging directory if not there
  file:
    path: "{{ swift_audit_log_base_location }}/swift"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0755
    state: directory
  when: swift_audit_enabled

- name: SWF-PRX | configure | Create api_audit_map.conf from template
  template:
    src: api_audit_map.conf.j2
    dest: "{{ swift_dir }}/api_audit_map.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  when: swift_audit_enabled
  notify:
    - swift_proxy_config_change
07070100000099000081A40000000000000000000000015C7A0D8A000008B0000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/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.
#
---
- include: ../../_SWF-CMN/tasks/install.yml

- name: SWF-PRX | install | Update venv cache
  become: yes
  install_package:
    cache: update

- name: SWF-PRX | install | Install Swift Proxy service
  install_package:
    name: swift
    service: "{{ item.key }}"
    state: present
    activate: act_off
  with_dict: "{{ swift_proxy_services }}"
  register: swift_proxy_install_result
  notify: swift_proxy_venv_change

# See swift-ansible/README for a description of the result structure
# returned by the install_package module

# Get the swift venv version, it is the same for all swift services.
- name: SWF-PRX | install | Set conf directory for the service
  set_fact:
    swift_venv_version: "{{ item.version }}"
  with_items: "{{ swift_proxy_install_result.results }}"

# swift_proxy_server_conf_dir is set to the correct dir whether the
# venv version changed or not.
- name: SWF-PRX | install | Set conf directory for the venv version
  set_fact:
    swift_proxy_server_conf_dir: "{{ 'swift-proxy-server' | config_dir(item.version) }}"
  with_items: "{{ swift_proxy_install_result.results }}"

- name: SWF-PRX | install | Register the Swift Proxy services
  setup_systemd:
    service: "{{ item.item.key }}"
    cmd: "{{ item.item.value.cmd }}"
    user: "{{ swift_user }}"
    group: "{{ swift_group }}"
    args: "{{ item.item.value.conf_service |
          config_dir(swift_venv_version) }}/{{ item.item.value.conf }}"
    limit_open_files: "{{ swift_proxy_limit_open_files }}"
  when: item.changed
  with_items: "{{ swift_proxy_install_result.results }}"

0707010000009A000081A40000000000000000000000015C7A0D8A000004C7000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/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: SWF-PRX | local_monitor | Setup active check on the Proxy Server locally
  become: yes
  monasca_agent_plugin:
    name: "httpcheck"
    args: "url=http://{{ proxy_bind_ip }}:{{ proxy_bind_port }}/healthcheck dimensions=service:object-storage,component:proxy-server"

- name: SWF-PRX | local_monitor | Setup active check on the Object Store VIP
  become: yes
  monasca_agent_plugin:
    name: "httpcheck"
    args: "url={{ object_store_private_vip }}/healthcheck dimensions=service:object-storage,component:object-storage-vip,monitored_host_type:vip,api_endpoint:private"
0707010000009B000081A40000000000000000000000015C7A0D8A00000283000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/tasks/populate.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.
#
---
0707010000009C000081A40000000000000000000000015C7A0D8A0000081F000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/tasks/start.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/_check_restart.yml

- name: SWF-PRX | start | Activate the latest install
  install_package:
    name: swift
    service: "{{ item.item.key }}"
    activate: act_on
    version: "{{ item.version }}"
  with_items: swift_proxy_install_result.results
  when: swift_proxy_install_result is defined

- name: SWF-PRX | start | Restart rsyslog
  service:
    name: rsyslog
    state: restarted
  when: ardana_notify_swift_common_rsyslog_restart_required is defined and
        ardana_notify_swift_common_rsyslog_restart_required.changed and
        swift_common_rsyslog_restarted is not defined
  register: swift_common_rsyslog_restarted

# For now restart rather than reload
# No need to restart here if swift-proxy restart is also happening
- name: SWF-PRX | start | Reload the Swift Proxy services
  service:
    name: swift-proxy-server
    state: restarted
  with_dict: "{{ swift_proxy_services }}"
  when: swift_proxy_reload_required and (not swift_restart_required) and
        (not swift_proxy_restart_required)

- name: SWF-PRX | start | Restart the Swift Proxy services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swift_proxy_services }}"
  when: swift_restart_required or swift_proxy_restart_required

- name: SWF-PRX | start | Start the Swift Proxy services
  service:
    name: "{{ item.key }}"
    state: started
  with_dict: "{{ swift_proxy_services }}"
0707010000009D000081A40000000000000000000000015C7A0D8A000002B8000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/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: ../../_SWF-CMN/tasks/_service_status.yml
0707010000009E000081A40000000000000000000000015C7A0D8A00000323000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/tasks/stop.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: SWF-PRX | stop | Stop the Swift Proxy services
  service:
    name: "{{ item.key }}"
    state: stopped
  with_dict: "{{ swift_proxy_services }}"
0707010000009F000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/templates070701000000A0000081A40000000000000000000000015C7A0D8A000003B4000000000000000000000000000000000000005600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/templates/api_audit_map.conf.j2{#
#
# (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.
#
#}
[DEFAULT]
# default target endpoint type
# should match the endpoint type defined in service catalog
target_endpoint_type = None

# possible end path of api requests
[path_keywords]

# map endpoint type defined in service catalog to CADF typeURI
[service_endpoints]
object = service/storage/object
070701000000A1000081A40000000000000000000000015C7A0D8A00000EB0000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/SWF-PRX/templates/proxy-server.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 OpenStack values that apply only to the Swift 
# service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
bind_port = {{ proxy_bind_port }}
bind_ip = {{ proxy_bind_ip }}
swift_dir = {{ swift_dir }}
user = {{ swift_user }}
workers = {{ swift_worker_count }}

[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk crossdomain tempurl formpost ratelimit authtoken keystoneauth{%- if swift_audit_enabled|bool %} audit{% endif %} staticweb container-quotas account-quotas slo dlo versioned_writes proxy-logging name_check proxy-server

[app:proxy-server]
use = egg:swift#proxy
account_autocreate = true
sorting_method = timing

[filter:catch_errors]
use = egg:swift#catch_errors

[filter:gatekeeper]
use = egg:swift#gatekeeper

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:proxy-logging]
use = egg:swift#proxy_logging

[filter:cache]
use = egg:swift#memcache

[filter:container_sync]
use = egg:swift#container_sync

[filter:bulk]
use = egg:swift#bulk

[filter:crossdomain]
use = egg:swift#crossdomain

[filter:tempurl]
use = egg:swift#tempurl

[filter:formpost]
use = egg:swift#formpost

[filter:ratelimit]
use = egg:swift#ratelimit

[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_uri = {{ keystone_auth_uri }}
auth_url = {{ keystone_auth_url }}
auth_plugin = password
project_domain_name = {{ keystone_default_domain }}
user_domain_name =  {{ keystone_default_domain }}
project_name = {{ keystone_service_tenant }}
username = {{ swift_user_name }}
password = {{ swift_user_password }}
cache = swift.cache
{% if SWF.audit.enabled|bool %}
include_service_catalog = True
{% else %}
include_service_catalog = False
{% endif %}
delay_auth_decision = true
#memcache_security_strategy = ENCRYPT
#memcache_secret_key = {{ swift_hash_path_prefix }}
cafile = {{ swift_ca_file }}
service_token_roles_required = true
service_token_roles = admin

{% if SWF.audit.enabled|bool %}
[filter:audit]
paste.filter_factory = keystonemiddleware.audit:filter_factory
audit_map_file = /etc/swift/api_audit_map.conf
use_oslo_messaging = false
{% endif %}

# Note to reviewer: I'm including all possible filters but not all are
# included in the pipeline (because they are not required)
[filter:versioned_writes]
use = egg:swift#versioned_writes
allow_versioned_writes = true

[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin, swiftoperator, _member_, Member

[filter:staticweb]
use = egg:swift#staticweb
url_base = https://

[filter:container-quotas]
use = egg:swift#container_quotas

[filter:account-quotas]
use = egg:swift#account_quotas

[filter:slo]
use = egg:swift#slo

[filter:dlo]
use = egg:swift#dlo

[filter:domain_remap]
use = egg:swift#domain_remap

[filter:cname_lookup]
use = egg:swift#cname_lookup

[filter:name_check]
use = egg:swift#name_check
forbidden_chars = "<>
maximum_length = 2348

[filter:list-endpoints]
use = egg:swift#list_endpoints

[filter:xprofile]
use = egg:swift#xprofile

## Do NOT put anything after this line ##
070701000000A2000041ED0000000000000000000000095C7A0D8A00000000000000000000000000000000000000000000003700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN070701000000A3000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/defaults070701000000A4000081A40000000000000000000000015C7A0D8A000018B1000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/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.
#
---

swift_restart_required: false

# Flags used to indicate swift system type
swift_proxy_server_role: false
swift_account_server_role: false
swift_container_server_role: false
swift_object_server_role: false

# Number of maximum worker allowed regardless of CPUs available
swift_max_workers: 8

# Number of workers for swift workers. The default will be the
# maximum allowed by variable swift_max_workers
swift_worker_count: "{{ ansible_processor_count * ansible_processor_cores * 2 | default('{{ swift_max_workers }}') }}"

swift_dir: /etc/swift
swiftlm_dir: /etc/swiftlm
swift_user: swift
swift_group: swift
swift_shell: /bin/false
# Need to have valid home dir, otherwise sudo -u swift will fail on SLES
swift_createhome: yes
# Note to reviewer. We need to pick a swift uid/gid that won't change
# from node to node. For now I'm hardcoding it here. Alternate suggestions
# welcome
#
# WARNING:  please DO NOT remove and change swift_uid and swift_gid with
# first updating the Swift tests first. Those tests are relying on the
# hardcoded uid and gid.
swift_uid: 154
swift_gid: 154

swift_hash_path_suffix: "{{ SWF_CMN.vars.swift_hash_path_prefix }}"
swift_hash_path_prefix: "{{ SWF_CMN.vars.swift_hash_path_prefix }}"

# Note to Reviewers: additional storage polifies like the commented out
# silver policy need to come from the user i.e. need a way for the user
# to specify storage policies and to have CP pass the data down.
# For now can hardcode here.
#storage_policies:
#  - policy:
#      index: 0
#      name: Policy-0
#      default: 'yes'
#  - policy:
#      index: 1
#      name: silver

mount_check: true
swift_devices: /srv/node/
recon_cache_path: /var/cache/swift

swift_logs_dir: /var/log/swift

swift_facts_dir: /etc/ansible/facts.d

# Directory where swiftlm conf files are located
swiftlm_etc: /etc/swiftlm
swiftlm_cache_path: /var/cache/swiftlm
swiftlm_scan_metrics: "{{ swiftlm_cache_path }}/swiftlm_scan_metrics.json"

# Swift service
swift_user_name: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_user }}"
swift_user_password: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_password | quote }}"

# Swift monitor tenant/user used by swift-uptime-mon
swift_monitor_tenant: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_monitor_user }}"
swift_monitor_description: 'Tenant-for-swift-uptime-mon'
swift_monitor_user: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_monitor_user }}"
swift_monitor_password: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_monitor_password }}"

# Swift dispersion tenant/user used by swift-dispersion-populate
swift_dispersion_tenant: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_dispersion_user }}"
swift_dispersion_description: 'Tenant-for-swift-dispersion-populate'
swift_dispersion_user: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_dispersion_user }}"
swift_dispersion_password: "{{ SWF_PRX.consumes_KEY_API.vars.keystone_swift_dispersion_password }}"

# Swift bind ips/ports
proxy_bind_port: "{% if host.bind.SWF_PRX is defined %}{{ host.bind.SWF_PRX.internal.port }}{% endif %}"
proxy_bind_ip: "{% if host.bind.SWF_PRX is defined %}{{ host.bind.SWF_PRX.internal.ip_address }}{% endif %}"
account_bind_port: "{% if host.bind.SWF_ACC is defined %}{{ host.bind.SWF_ACC.internal.port }}{% endif %}"
account_bind_ip: "{% if host.bind.SWF_ACC is defined %}{{ host.bind.SWF_ACC.internal.ip_address }}{% endif %}"
container_bind_port: "{% if host.bind.SWF_CON is defined %}{{ host.bind.SWF_CON.internal.port }}{% endif %}"
container_bind_ip: "{% if host.bind.SWF_CON is defined %}{{ host.bind.SWF_CON.internal.ip_address }}{% endif %}"
object_bind_port: "{% if host.bind.SWF_OBJ is defined %}{{ host.bind.SWF_OBJ.internal.port }}{% endif %}"
object_bind_ip: "{% if host.bind.SWF_OBJ is defined %}{{ host.bind.SWF_OBJ.internal.ip_address }}{% endif %}"
rsync_bind_port: "{% if host.bind.SWF_RSY is defined %}{{ host.bind.SWF_RSY.internal.port }}{% endif %}"
rsync_bind_ip: "{% if host.bind.SWF_RSY is defined %}{{ host.bind.SWF_RSY.internal.ip_address }}{% endif %}"

# Keystone authtoken
# auth_uri should point to a Keystone service from which users may
# retrieve tokens.
keystone_auth_uri: "{{ KEY_API.advertises.vips.public[0].url }}"
# auth_url points to the Keystone Admin service. This information is
# used by the middleware to actually query Keystone about the validity of the
# authentication tokens. It is not necessary to append any Keystone API version
# number to this URI.
keystone_auth_url: "{{ SWF_PRX.consumes_KEY_API.vips.private[0].url }}"

keystone_default_domain: "{{ KEY_API.vars.keystone_default_domain }}"
keystone_service_tenant: "{{ KEY_API.vars.keystone_service_tenant }}"

memcache_servers: "{{ SWF_PRX.consumes_FND_MEM.members.private }}"
swift_ca_file: "{{ trusted_ca_bundle }}"
swift_storage_servers: "{{ groups[verb_hosts.SWF_ACC] | union(groups[verb_hosts.SWF_CON]) | union(groups[verb_hosts.SWF_OBJ]) | unique }}"

# Swift conf dirs
swift_object_conf_dir: /opt/stack/service/swift-object-server/etc

# Audit configuration
swift_audit_enabled: "{{ SWF.audit.enabled }}"
swift_audit_log_base_location: "{{ SWF.audit.dir }}"
swift_audit_log_file: "{{SWF.audit.dir }}/swift/swift-audit.log"

#Object Store
object_store_private_vip: "{{ SWF_PRX.advertises.vips.private[0].url }}"

# Ring specifications are now in configuration-data. However, to transition to
# the new layout, we support the rings being in a top-level ring-specifications
# object.
ring_specifications: "{% if config_data.SWF is defined and config_data.SWF.control_plane_rings is defined %}{{ config_data.SWF.control_plane_rings }}{% else %}{{ global.all_ring_specifications | default([])}}{% endif %}"
070701000000A5000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/handlers070701000000A6000081A40000000000000000000000015C7A0D8A000002D2000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/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.
#
---

- name: swift_config_change
  set_fact:
    swift_restart_required: true
070701000000A7000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/library070701000000A8000081A40000000000000000000000015C7A0D8A000010E8000000000000000000000000000000000000005300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/library/storage_policies.py#!/usr/bin/python
#
# (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.
#
import json
import shlex
import sys


def dash_to_underscore(obj):
    """
    Configuration data is not underscored
    :param obj: The object to convert
    :return:The converted object
    """
    if isinstance(obj, list):
        ret_obj = []
        for item in obj:
            ret_obj.append(dash_to_underscore(item))
    elif isinstance(obj, dict):
        ret_obj = dict()
        for key in obj.keys():
            new_key = key.replace('-', '_')
            ret_obj[new_key] = dash_to_underscore(obj[key])
    else:
        ret_obj = obj
    return ret_obj


def get_storage_policies(ring_model):
    ring_model = dash_to_underscore(ring_model)
    rings = []
    if isinstance(ring_model, dict):
        # Rings are now in configuration data
        rings = ring_model.get('rings', [])
    else:
        # Rings used to be in a top-level ring-specifications object
        # Support this mode until CP moves them to the config-data object
        # The rings were indexed by region, but this was never used, so just
        # pull off first item.
        if len(ring_model) > 0:
            rings = ring_model[0].get('rings')
    storage_policies = []

    for ring in rings:
        if ring.get('name').startswith('object-'):
            index = ring.get('name')[7:]
            name = ring.get('display_name')
            aliases = ring.get('aliases', [])
            aliases_csv = ','.join(aliases)
            if 'erasure_coding_policy' in ring:
                ec_type = ring.get('erasure_coding_policy').get('ec_type')
                ec_data = ring.get('erasure_coding_policy').get(
                    'ec_num_data_fragments')
                ec_parity = ring.get('erasure_coding_policy').get(
                    'ec_num_parity_fragments')
                ec_seg_size = ring.get('erasure_coding_policy').get(
                    'ec_object_segment_size', '1048576')
                policy = {'policy': {'index': index,
                                     'name': name,
                                     'aliases_csv': aliases_csv,
                                     'ec_type': ec_type,
                                     'ec_data': ec_data,
                                     'ec_parity': ec_parity,
                                     'ec_seg_size': ec_seg_size,
                                     'default': 'no'}}
            else:
                policy = {'policy': {'index': index,
                                     'name': name,
                                     'aliases_csv': aliases_csv,
                                     'default': 'no'}}
            if ring.get('default', False):
                policy['policy']['default'] = 'yes'

            storage_policies.append(policy)

    return storage_policies


def main():
    ringspecs = ''
    region_name = ''
    try:
        args_file = sys.argv[1]
        args_data = file(args_file).read()
        arguments = shlex.split(args_data)
    except (IndexError, IOError):
        arguments = sys.argv  # Running interactively
    for arg in arguments:
        if "=" in arg:
            (key, value) = arg.split('=')
            if key == 'ring-specifications':
                ringspecs = value

    ringspecs = ringspecs.replace("'", '"')          # fix single quotes
    ringspecs = ringspecs.replace('True', 'true')    # fix boolean
    ringspecs = ringspecs.replace('False', 'false')  # fix boolean
    storage_policies = get_storage_policies(json.loads(ringspecs))
    ret = {}
    ret['failed'] = False
    ret['rc'] = 0
    ret['ansible_facts'] = {'storage_policies': storage_policies}
    print(json.dumps(ret))


if __name__ == '__main__':
    main()
070701000000A9000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/meta070701000000AA000081A40000000000000000000000015C7A0D8A00000263000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/meta/main.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.
#
---
dependencies:
  - role: tls-vars
070701000000AB000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/tasks070701000000AC000081A40000000000000000000000015C7A0D8A0000043F000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/tasks/_check_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.
#
---
# Trigger a global service restart if the special
# ardana_notify_swift_restart_required variable was set
- name: _SWF_CMN | _check_restart | Check restart notification
  debug:
    msg: "Trigger swift services to restart"
  changed_when: true
  when: ardana_notify_swift_restart_required is defined and
        ardana_notify_swift_restart_required.changed
  notify:
    - swift_config_change

- name: _SWF_CMN | _check_restart | Ensure handlers are executed right away
  become: yes
  meta: flush_handlers
070701000000AD000081A40000000000000000000000015C7A0D8A000003EA000000000000000000000000000000000000005300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/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: _SWF-CMN | _schedule_restart | Schedule a restart for all services
  debug:
    msg: "Trigger a change notification in swift"
  changed_when: true
  register: ardana_notify_swift_restart_required

- name: _SWF-CMN | _schedule_restart | Schedule a restart for rsyslog
  debug:
    msg: "Trigger a change notification for rsyslog"
  changed_when: true
  register: ardana_notify_swift_common_rsyslog_restart_required
070701000000AE000081A40000000000000000000000015C7A0D8A000003BD000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/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: _SWF_CMN | status | Check systemd service running
  command: systemctl status "{{ item.key }}"
  changed_when: false
  when: (ardana_pre_upgrade_check is defined and item.value.post_upgrade is not defined) or
        (ardana_pre_upgrade_check is not defined)
  with_dict: "{{ swift_component }}_services"
070701000000AF000081A40000000000000000000000015C7A0D8A00000B35000000000000000000000000000000000000004B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: SWF-ACC | configure | Set max worker count to 8 if dynamic
    CPU based count is greater than {{ swift_max_workers }}
  set_fact:
    swift_worker_count: "{{ swift_max_workers }}"
  when: swift_worker_count > swift_max_workers

- name: _SWF_CMN | configure | Create swift_dir directory
  file:
    path: "{{ swift_dir }}"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0755
    state: directory

- name: _SWF_CMN | configure | Create swift_logs_dir directory
  file:
    path: "{{ swift_logs_dir }}"
    owner: root
    group: adm
    mode: 0755
    state: directory

- name: _SWF_CMN | configure | Create recon_cache_path directory
  file:
    path: "{{ recon_cache_path }}"
    owner: swift
    group: swift
    mode: 0755
    state: directory

- name: _SWF_CMN | configure | Create swift_facts_dir directory
  file:
    path: "{{ swift_facts_dir }}"
    owner: root
    group: root
    mode: 0755
    state: directory

- name: _SWF_CMN | configure | Copy /etc/rsyslog.d/40-swift.conf
  template:
    src: 40-swift.conf.j2
    dest: /etc/rsyslog.d/40-swift.conf
    owner: root
    group: root
    mode: 0644
  register: ardana_notify_swift_common_rsyslog_restart_required

- name: _SWF_CMN | configure | Create disk_models yml file
  template:
    src: disk_models.j2
    dest: /etc/swift/disk_models.yml
    owner: swift
    group: swift
    mode: 0444

- name: _SWF_CMN | configure | Add drive-audit config file
  template:
    src: drive-audit.conf.j2
    dest: "{{ swift_dir }}/drive-audit.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400

- name: _SWF_CMN | configure | Copy /etc/swift/memcache.conf
  template:
    src: memcache.conf.j2
    dest: /etc/swift/memcache.conf
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swift_config_change

- name: _SWF_CMN | configure | Create swiftlm_cache_path directory
  file:
    path: "{{ swiftlm_cache_path }}"
    owner: root
    group: root
    mode: 0755
    state: directory

- name: _SWF_CMN | configure | Copy /etc/cron.d/swiftlm-scan
  template:
    src: swiftlm-scan.j2
    dest: /etc/cron.d/swiftlm-scan
    owner: root
    group: root
    mode: 0644
070701000000B0000081A40000000000000000000000015C7A0D8A000002FA000000000000000000000000000000000000005B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/tasks/get_storage_policies_fact.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: _SWF-CMN | get storage_policies fact
  storage_policies: ring-specifications="{{ ring_specifications }}"
070701000000B1000081A40000000000000000000000015C7A0D8A00000F37000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/tasks/install.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: _SWF_CMN | install | Add group {{ swift_group }}
  become: yes
  group:
    name: "{{ swift_group }}"
    gid: "{{ swift_gid }}"

- name: _SWF_CMN | install | Add user {{ swift_user }}
  become: yes
  user:
    name: "{{ swift_user }}"
    uid: "{{ swift_uid }}"
    group: "{{ swift_group }}"
    createhome: "{{ swift_createhome }}"
    shell: "{{ swift_shell }}"

- name: _SWF_CMN | install | Set Permissions {{ swift_createhome }}
  become: yes
  file:
    path: "/home/swift"
    state: directory
    mode: 0750
  when: swift_createhome

# The swift-common service is created simply as a convenience for
# creating symlinks from /usr/local/bin to the swift scripts in
# /opt/stack/service/swift-common/venv/bin
# As such there is no need to postpone activation, register a systemd service
# or restart any services.
- name: _SWF_CMN | install | Install Swift swift-common service
  install_package:
    name: swift
    service: swift-common
    state: present

- name: _SWF_CMN | install | Install Prerequisites
  become: yes
  package:
    name: "{{ item }}"
    state: present
  with_items: swift_packages

# The swiftlm is not a service that needs to be started.
# There is no need to postpone activation, register a systemd service
# or restart any services.
# Its sole purpose if to facilitate creating symlinks from /usr/local/bin
# to the swiftlm scripts in /opt/stack/service/swiftlm/venv/bin
- name: _SWF_CMN | install | Install swiftlm service (legacy)
  install_package:
    name: swiftlm
    service: swiftlm
    state: present
  when: deployer_media_legacy_layout|bool

# We dont want to have to update in two locations for each new script so we
# symlink all executables that exist in the bin dir's.
- name: _SWF_CMN | install | Get swift-common files for symlinking (legacy)
  command: "find {{ 'swift-common' | bin_dir() }} -maxdepth 1 -type f -executable -name \"swift*\""
  register: swift_common_symlink_targets
  when: deployer_media_legacy_layout|bool

- name: _SWF_CMN | install | Get swiftlm files for symlinking
  command: "find {{ 'swiftlm' | bin_dir() }} -maxdepth 1 -type f -executable -name \"swift*\""
  register: swiftlm_symlink_targets
  when: deployer_media_legacy_layout|bool

- name: _SWF_CMN | install | Create symlinks to binaries (legacy)
  file:
    src: "{{ item }}"
    dest: "/usr/local/bin/{{ item | basename }}"
    owner: root
    group: root
    state: link
  with_items:
    - "{{ swift_common_symlink_targets.stdout_lines }}"
    - "{{ swiftlm_symlink_targets.stdout_lines }}"
  when: deployer_media_legacy_layout|bool

- name: _SWF_CMN | install | Install swiftlm service (rpm)
  package:
    name: python-swiftlm
    state: present
  become: yes
  when: deployer_media_legacy_layout|bool == false

- name: _SWF-CMN | install | Comment contents of default log rotation script
  become: yes
  shell: sed -i -e 's/^/#/' $(grep -lv "#" /etc/logrotate.d/openstack-swift)
  failed_when: false

# Swiftlm expects parted binaries to be in /sbin
- name: _SWF_CMN | install | Suse - create symlink for parted
  become: yes
  file:
      src: /usr/sbin/{{ item }}
      dest: /sbin/{{ item }}
      state: link
  with_items:
    - parted
    - partprobe
  when: ansible_os_family == 'Suse'
070701000000B2000081A40000000000000000000000015C7A0D8A000002EE000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/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: _SWF_CMN | main | Set os-specific variables
  include_vars: "{{ ansible_os_family | lower }}.yml"

070701000000B3000081A40000000000000000000000015C7A0D8A00000403000000000000000000000000000000000000005300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/tasks/provision_storage.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: _SWF_CMN | provision_storage | Create partitions and file systems
  command: swiftlm-drive-provision -p
  become: yes

- name: _SWF_CMN | provision_storage | Create partition and file system labels
  command: swiftlm-drive-provision -l
  become: yes

- name: _SWF_CMN | provision_storage | Mount file systems by label
  command: swiftlm-drive-provision -m
  become: yes
070701000000B4000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/templates070701000000B5000081A40000000000000000000000015C7A0D8A00000D9D000000000000000000000000000000000000005200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/templates/40-swift.conf.j2{#
#
# (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.
#
#}
template(name="swift_json" type="list" option.json="on") {
    constant(value="{")
    constant(value="\"tags\": \"") property(name="programname")
    constant(value="\", \"color\": \"")
    constant(value="\", \"@timestamp\": \"") property(name="timereported" dateFormat="rfc3339")
    constant(value="\", \"@version\": 1")
    constant(value=", \"version\": \"unknown")
    constant(value="\", \"user_identity\": null")
    constant(value=", \"project\": \"unknown")
    constant(value="\", \"instance\": \"")
    constant(value="\", \"host\": \"") property(name="hostname")
    constant(value="\", \"logger\": \"swift.wsgi.server")
    constant(value="\", \"type\": \"swift")
    constant(value="\", \"message\": \"") property(name="msg")
    constant(value="\", \"levelname\": \"") property(name="syslogseverity-text" CaseConversion="upper")
    constant(value="\"}\n")
}
:programname, contains, "swiftlm-uptime" action(type="omfile" fileCreateMode="0640" FileGroup="adm" file="/var/log/swiftlm/uptime-mon-json.log" template="swift_json")
:programname, contains, "swiftlm-uptime" /var/log/swiftlm/uptime-mon.log
& stop

# Generate json audit log for centralised logging. It is not required to create non json log file.
# Note also, the logfile name should not include the text json.
:msg, contains, "Event type: audit.http" action(type="omfile" fileCreateMode="0640" FileGroup="adm" file="{{ swift_audit_log_file }}" template="swift_json")
& stop

:programname, contains, "swift" action(type="omfile" fileCreateMode="0640" FileGroup="adm" file="{{ swift_logs_dir }}/swift-json.log" template="swift_json")
:programname, contains, "account" action(type="omfile" fileCreateMode="0640" FileGroup="adm" file="{{ swift_logs_dir }}/swift-json.log" template="swift_json")
:programname, contains, "container" action(type="omfile" fileCreateMode="0640" FileGroup="adm" file="{{ swift_logs_dir }}/swift-json.log" template="swift_json")
:programname, contains, "object" action(type="omfile" fileCreateMode="0640" FileGroup="adm" file="{{ swift_logs_dir }}/swift-json.log" template="swift_json")
:programname, contains, "proxy-server" action(type="omfile" fileCreateMode="0640" FileGroup="adm" file="{{ swift_logs_dir }}/swift-json.log" template="swift_json")

# The "& stop" is included after each of the following swift rules to ensure
# that the msg is discarded after being written to the swift log. As a
# result it does not get logged to other logs such as /var/log/syslog.
:programname, contains, "swift" {{ swift_logs_dir }}/swift.log
& stop
:programname, contains, "account" {{ swift_logs_dir }}/swift.log
& stop
:programname, contains, "container" {{ swift_logs_dir }}/swift.log
& stop
:programname, contains, "object" {{ swift_logs_dir }}/swift.log
& stop
:programname, contains, "proxy-server" {{ swift_logs_dir }}/swift.log
& stop
070701000000B6000081A40000000000000000000000015C7A0D8A000002AE000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/templates/disk_models.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.
#
#}
{{ host.my_disk_models | to_nice_yaml }}
070701000000B7000081A40000000000000000000000015C7A0D8A000003C0000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/templates/drive-audit.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.
#
#}
[drive-audit]
device_dir = {{ swift_devices }}
log_facility = LOG_LOCAL0
log_level = DEBUG
minutes = 240
error_limit = 1
unmount_failed_device = False
log_to_console = True
regex_pattern1 = \berror\b.*\b(sd[a-z]){1,2}\d?\b
regex_pattern2 = \b(sd[a-z]){1,2}\d?\b.*\berror\b
recon_cache_path = {{ recon_cache_path }}
070701000000B8000081A40000000000000000000000015C7A0D8A000003BB000000000000000000000000000000000000005200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/templates/memcache.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 Swift 
# service.
# You may make changes to this file by adding sections/options below.

[memcache]
memcache_servers = {% for item in memcache_servers -%}
    {{ item.host }}:{{ item.port }}{% if loop.revindex > 1 %},{% endif %}
{%- endfor %}
070701000000B9000081A40000000000000000000000015C7A0D8A00000645000000000000000000000000000000000000004F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/templates/swift.conf.j2{#
#
# (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 has the Ardana OpenStack values that apply only to the Swift 
# service.
# You may make changes to this file by adding sections/options below.

[swift-hash]

swift_hash_path_suffix = {{ swift_hash_path_suffix }}
swift_hash_path_prefix = {{ swift_hash_path_prefix }}

# Storage Policies
{% if storage_policies is defined %}
{%   for policy in storage_policies %}
[storage-policy:{{ policy.policy.index }}]
name = {{ policy.policy.name }}
aliases = {{ policy.policy.aliases_csv }}
{%     if policy.policy.default is defined %}
default = {{ policy.policy.default }}
{%     endif %}
{%     if policy.policy.ec_type is defined %}
policy_type = erasure_coding
ec_type = {{ policy.policy.ec_type }}
ec_num_data_fragments = {{ policy.policy.ec_data }}
ec_num_parity_fragments = {{ policy.policy.ec_parity }}
ec_object_segment_size = {{ policy.policy.ec_seg_size }}
{%     endif %}
{%   endfor %}
{% endif %}

## Do NOT put anything after this line ##
070701000000BA000081A40000000000000000000000015C7A0D8A00000341000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/templates/swiftlm-scan.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.
#
#}
# Cronjob to run swiftlm-scan
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
*/1 * * * * root swiftlm-scan --filename {{ swiftlm_scan_metrics }}
070701000000BB000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/vars070701000000BC000081A40000000000000000000000015C7A0D8A000002F9000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/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.
#
---

swift_packages:
  - xfsprogs
  - parted
  - ssacli
  - liberasurecode-dev
  - libgf-complete1
  - libjerasure2

070701000000BD000081A40000000000000000000000015C7A0D8A00000338000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-CMN/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.
#
---

swift_packages:
  # - hpssacli
  - liberasurecode1
  # - libgf-complete1
  # - libjerasure2
  - logrotate
  - memcached
  - parted
  - python-netifaces
  - rsync
  - xfsprogs
070701000000BE000041ED0000000000000000000000085C7A0D8A00000000000000000000000000000000000000000000003700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY070701000000BF000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/defaults070701000000C0000081A40000000000000000000000015C7A0D8A000002CB000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/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.
#
---
# Flag to track restart requirement
swift_rsync_restart_required: false
070701000000C1000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/handlers070701000000C2000081A40000000000000000000000015C7A0D8A000002CE000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: Restart rsyncd
  set_fact:
    swift_rsync_restart_required: true
070701000000C3000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/meta070701000000C4000081A40000000000000000000000015C7A0D8A000002C6000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/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: _SWF-CMN
  - role: swiftlm-ring-supervisor
070701000000C5000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/tasks070701000000C6000081A40000000000000000000000015C7A0D8A00000433000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/tasks/_check_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.
#
---
# Trigger a service restart if the special
# ardana_notify_swift_restart_required variable was set
- name: _SWF-RSY | _check_restart | Check restart notification
  debug:
    msg: "Trigger rsyncd service to restart"
  changed_when: true
  when: ardana_notify_swift_restart_required is defined and
        ardana_notify_swift_restart_required.changed
  notify:
    - Restart rsyncd

- name: _SWF_RSY | _check_restart | Ensure handlers are executed right away
  become: yes
  meta: flush_handlers
070701000000C7000081A40000000000000000000000015C7A0D8A00000595000000000000000000000000000000000000004B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include_vars: "{{ ansible_os_family | lower }}.yml"

- name: _SWF-RSY | configure | Copy /etc/rsyncd.conf
  template:
    src: rsyncd.conf.j2
    dest: /etc/rsyncd.conf
    owner: root
    group: root
    mode: 0644
  notify:
    - Restart rsyncd

- name: _SWF-RSY | configure | Debian - Enable rsync in defaults file
  lineinfile:
    dest: /etc/default/rsync
    state: present
    regexp: '^RSYNC_ENABLE(.*)=(.*)false'
    line: 'RSYNC_ENABLE=true'
  when: ansible_os_family == 'Debian'

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: _SWF-RSY | configure | Enable the rsync service to start on boot
  command: systemctl reenable "{{ swift_rsync_service_name }}"
070701000000C8000081A40000000000000000000000015C7A0D8A00000445000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/tasks/start.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.
#
---
- include: _check_restart.yml

- include_vars: "{{ ansible_os_family | lower }}.yml"

- name: _SWF-RSY | start | Restart rsyncd
  service:
    name: "{{ swift_rsync_service_name }}"
    state: restarted
  when: swift_rsync_restart_required

- set_fact:
    swift_rsync_restart_required: false
  when: swift_rsync_restart_required

- name: _SWF-RSY | start | Start rsyncd
  service:
    name: "{{ swift_rsync_service_name }}"
    state: started

070701000000C9000081A40000000000000000000000015C7A0D8A000002D8000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/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.
#
---

- name: _SWF-RSY | stop | Stop rsyncd
  service:
    name: rsync
    state: stopped
070701000000CA000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/templates070701000000CB000081A40000000000000000000000015C7A0D8A000005A2000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/templates/rsyncd.conf.j2{#
#
# (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 has the Ardana OpenStack values that apply only to the Swift 
# service.
# You may make changes to this file by adding sections/options below.

uid = {{ swift_user }}
gid = {{ swift_group }}
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = {{ rsync_bind_ip }}
port = {{ rsync_bind_port }}

[rings]
path = {{ swiftlm_etc }}/{{ this_swift_instance }}/builder_dir
read only = false

[account]
max connections = 2
path = {{ swift_devices }}
read only = false
lock file = /var/lock/account.lock

[container]
max connections = 4
path = {{ swift_devices }}
read only = false
lock file = /var/lock/container.lock

[object]
max connections = 8
path = {{ swift_devices }}
read only = false
lock file = /var/lock/object.lock

## Do NOT put anything after this line ##
070701000000CC000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/vars070701000000CD000081A40000000000000000000000015C7A0D8A0000028C000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/vars/debian.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.
#
---
# systemd service name for rsync daemon
swift_rsync_service_name: rsync
070701000000CE000081A40000000000000000000000015C7A0D8A0000028D000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/_SWF-RSY/vars/suse.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.
#
---
# systemd service name for rsync daemon
swift_rsync_service_name: rsyncd
070701000000CF000041ED0000000000000000000000065C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer070701000000D0000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/defaults070701000000D1000081A40000000000000000000000015C7A0D8A000002F9000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/defaults/main.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

access_log_tailer_restart_required: false

access_tailer_metrics: "{{ swiftlm_cache_path }}/access_log_metrics.json"
070701000000D2000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/handlers070701000000D3000081A40000000000000000000000015C7A0D8A000002DD000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: access_log_tailer_change
  set_fact:
    access_log_tailer_restart_required: true070701000000D4000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/tasks070701000000D5000081A40000000000000000000000015C7A0D8A00000452000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/tasks/_check_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.
#
---
# Trigger a service restart if the special
# ardana_notify_swift_restart_required variable was set
- name: access-tailer | _check_restart | Check restart notification
  debug:
    msg: "Trigger swiftlm-access-log-tailer to restart"
  changed_when: true
  when: ardana_notify_swift_restart_required is defined and
        ardana_notify_swift_restart_required.changed
  notify:
    - access_log_tailer_change

- name: access-tailer | _check_restart | Ensure handlers are executed right away
  become: yes
  meta: flush_handlers
070701000000D6000081A40000000000000000000000015C7A0D8A0000039F000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/tasks/configure.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: access-tailer | configure | Make access log tailer config
  template:
    src: access-log-tailer.conf.j2
    dest: "{{ swiftlm_dir }}/access-log-tailer.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - access_log_tailer_change
070701000000D7000081A40000000000000000000000015C7A0D8A00000654000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/tasks/install-legacy.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: access-tailer | install | Update venv cache (legacy)
  become: yes
  install_package:
    cache: update

- name: access-tailer | install | Install access tailer package (legacy)
  install_package:
    name: "swiftlm"
    service: "swiftlm-access-log-tailer"
    state: "present"
    activate: "act_off"
  register: access_log_tailer_venv_result
  notify: access_log_tailer_change

- name: access-tailer | install | Register access tailer (legacy)
  setup_systemd:
    service: "swiftlm-access-log-tailer"
    cmd: "swiftlm-log-tailer"
    user: root
    group: root
    args: "--config {{ swiftlm_dir }}/access-log-tailer.conf"
  when: access_log_tailer_venv_result.changed

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: access-tailer | install | Enable access tailer to start on boot (legacy)
  command: systemctl reenable swiftlm-access-log-tailer
070701000000D8000081A40000000000000000000000015C7A0D8A000004B4000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/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.
#
---

- name: access-tailer | install | Install access tailer (legacy)
  include: install-legacy.yml
  when: deployer_media_legacy_layout|bool

- name: access-tailer | install | Install access tailer (rpm)
  become: yes
  package:
    name: ardana-swiftlm-log-tailer
    state: present
  when: deployer_media_legacy_layout|bool == false

- name: access-tailer | install | Enable access tailer service (rpm)
  command: systemctl reenable swiftlm-log-tailer
  become: yes
  notify: access_log_tailer_change
  when: deployer_media_legacy_layout|bool == false
070701000000D9000081A40000000000000000000000015C7A0D8A00000502000000000000000000000000000000000000004C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/tasks/start.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: _check_restart.yml

- name: access-tailer | start | Activate the latest install
  install_package:
    name: "swiftlm"
    service: "swiftlm-access-log-tailer"
    activate: "act_on"
    version: "{{ access_log_tailer_venv_result.version }}"
  when: access_log_tailer_venv_result is defined and deployer_media_legacy_layout|bool

- name: swift-monitor | start | Restart the access tailer
  service:
    name: swiftlm-access-log-tailer
    state: restarted
  when: access_log_tailer_restart_required

- name: access-tailer | start | Start the access tailer
  service:
    name: swiftlm-access-log-tailer
    state: started

070701000000DA000081A40000000000000000000000015C7A0D8A00000301000000000000000000000000000000000000004B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/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.
#
---

- name: access-tailer | stop | Stop the access log tailer
  service:
    name: swiftlm-access-log-tailer
    state: stopped

070701000000DB000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/templates070701000000DC000081A40000000000000000000000015C7A0D8A00000381000000000000000000000000000000000000006000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/access-tailer/templates/access-log-tailer.conf.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.
#
#}

[log-tailer]
tailed_log_file={{ swift_logs_dir }}/swift.log
metric_file={{ access_tailer_metrics }}
interval=60
monasca_agent_interval=30
reseller_prefixes=AUTH_

[logging]
log_level = info
log_facility = LOG_LOCAL0
log_format = '%(name)s: %(message)s'
070701000000DD000041ED0000000000000000000000065C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion070701000000DE000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/defaults070701000000DF000081A40000000000000000000000015C7A0D8A000002E2000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/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.
#
---
endpoint_type: internalURL
disp_auth_version: 3.0
swift_dispersion_conf_dir: "{{ swift_dir }}"
070701000000E0000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/meta070701000000E1000081A40000000000000000000000015C7A0D8A000002A4000000000000000000000000000000000000004D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/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: _SWF-CMN
070701000000E2000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/tasks070701000000E3000081A40000000000000000000000015C7A0D8A0000057E000000000000000000000000000000000000005300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/tasks/configure.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: ../../_SWF-CMN/tasks/configure.yml

- name: swift-dispersion | configure | Copy /etc/swift/dispersion.conf
  template:
    src: dispersion.conf.j2
    dest: "{{ swift_dispersion_conf_dir }}/dispersion.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400

- name: swift-dispersion | configure | Create file /var/cache/swift/dispersion-report
  file:
    path: "{{ recon_cache_path }}/dispersion-report"
    state: touch
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0755

- name: swift-dispersion | configure | Create file /etc/cron.d/dispersion-report-cron
  template:
    src: dispersion-report-cron.j2
    dest: "/etc/cron.d/dispersion-report-cron"
    owner: root
    group: root
    mode: 0755
070701000000E4000081A40000000000000000000000015C7A0D8A000005AE000000000000000000000000000000000000005200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/tasks/populate.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: swift-dispersion | populate | Run swift-dispersion-populate
  command: >
    swift-dispersion-populate {{ swift_dispersion_conf_dir }}/dispersion.conf
    --policy-name={{ item.policy.name }}
  become: yes
  register: dispersion_populate_result
  with_items: "{{ storage_policies }}"

- name: swift-dispersion | populate | Save dispersion populate results
  set_fact: output= "{{ item }}"
  register: output_result
  no_log: True
  with_items: "{{ dispersion_populate_result.results }}"

- name: swift-dispersion | populate | Get dispersion populate results
  set_fact: >
    dispersion_populate_results="{{ output_result.results |
    map(attribute='item.stdout_lines') | list }}"

- name: swift-dispersion | populate | Display dispersion populate result
  debug: var=dispersion_populate_results
070701000000E5000081A40000000000000000000000015C7A0D8A000006D3000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/tasks/report.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: swift-dispersion | report | Run swift-dispersion-report
  command: swift-dispersion-report --policy-name={{ item.policy.name }}
  become: yes
  register: dispersion_report_result
  with_items: "{{ storage_policies }}"

- name: swift-dispersion | report | Save dispersion report results
  set_fact: output= "{{ item }}"
  register: output_result
  no_log: True
  with_items: "{{ dispersion_report_result.results }}"

- name: swift-dispersion | report | Check if populate has been run
  set_fact: run_populate=True
  no_log: True
  with_items: "{{ dispersion_report_result.results }}"
  when: "'swift-dispersion-populate' in item.stderr"

- name: swift-dispersion | report | Get dispersion report results
  set_fact: >
    dispersion_report_results="{{ output_result.results |
    map(attribute='item.stdout_lines') | list }}"

- name: swift-dispersion | report | Display dispersion report results
  debug: var=dispersion_report_results

- name: swift-dispersion | report | Warn when populate not yet run
  debug: msg="Please run swift-dispersion-populate.yml"
  when: run_populate is defined
070701000000E6000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/templates070701000000E7000081A40000000000000000000000015C7A0D8A00000381000000000000000000000000000000000000006300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/templates/dispersion-report-cron.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.
#
#}
# Cronjob that runs dispersion report every 2 hours
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
0 */2 * * * {{ swift_user }} /usr/local/bin/swift-dispersion-report > /var/cache/swift/dispersion-report 2>&1
070701000000E8000081A40000000000000000000000015C7A0D8A0000045F000000000000000000000000000000000000005C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-dispersion/templates/dispersion.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.
#
#}
[dispersion]
auth_url = {{ keystone_auth_url }}/v3
auth_user = {{ swift_dispersion_tenant }}:{{ swift_dispersion_user }}
auth_key = {{ swift_dispersion_password  }}
endpoint_type = {{ endpoint_type }}
auth_version = {{ disp_auth_version }}
# Set this to the percentage coverage. We recommend a value
# of 1%. You can increase this to get more coverage. However, if you
# decrease the value, the dispersion containers and objects are
# not deleted.
dispersion_coverage = 1.0
070701000000E9000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000003F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional070701000000EA000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/defaults070701000000EB000081A40000000000000000000000015C7A0D8A00000700000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/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.
#
---
swift_functional_test_non_operator_role: swf_func_non_operator_role

swift_functional_test_users:
    swf_func_tester:
        project_name: swf_func_test
        password: testing
        domain: "{{ keystone_user_domain_name }}"
        role: admin
    swf_func_tester2:
        project_name: swf_func_test2
        password: testing2
        domain: "{{ keystone_user_domain_name }}"
        role: admin
    swf_func_tester3:
        project_name: swf_func_test
        password: testing3
        domain: "{{ keystone_user_domain_name }}"
        role: "{{ swift_functional_test_non_operator_role }}"
# Do not have multiple domains so tester4 not needed
#    swf_func_tester4:
#        project_name: swf_func_test4
#        password: testing4
#        domain: swf_func_non_default_domain
#        role: admin
# Do not have multiple resellers so tester5 not needed
#    swf_func_tester5:
#        project_name: swf_func_test5
#        password: testing5
#        domain: "{{ keystone_user_domain_name }}"
#        role: service

auth_url: "{{ KEY_API.advertises.vips.public[0].url }}"
auth_ip: "{{ KEY_API.advertises.vips.public[0].ip_address }}"
070701000000EC000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/library070701000000ED000081ED0000000000000000000000015C7A0D8A0000061B000000000000000000000000000000000000005400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/library/urlparser.py#!/usr/bin/python

#
# (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 json
import shlex
import sys
from urlparse import urlparse


def main():
    url = ''
    factname ='urlparse_result'
    try:
        args_file = sys.argv[1]
        args_data = file(args_file).read()
        arguments = shlex.split(args_data)
    except (IndexError, IOError):
        arguments = sys.argv  # Running interactively
    for arg in arguments:
        if "=" in arg:
            (key, value) = arg.split('=')
            if key == 'url':
                url = value
            elif key == 'factname':
                factname = value

    result = urlparse(url)
    ret = {}
    ret['failed'] = False
    ret['rc'] = 0
    ret['ansible_facts'] = {factname: {'scheme': result.scheme,
                                       'hostname': result.hostname,
                                       'port': result.port}}
    print(json.dumps(ret))


if __name__ == '__main__':
    main()


070701000000EE000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/meta070701000000EF000081A40000000000000000000000015C7A0D8A000002C3000000000000000000000000000000000000004D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/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: swift-post-configure
  - role: _SWF-CMN
070701000000F0000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/tasks070701000000F1000081A40000000000000000000000015C7A0D8A00000425000000000000000000000000000000000000005300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/tasks/configure.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: swift-functional | configure | Get AUTH details
  urlparser:
      url: "{{ auth_url }}"
      factname: "auth"

- name: swift-functional | configure | Create a test.conf file
  template:
    src: test.conf.j2
    dest: "/tmp/test.conf"
    mode: 0400

- name: swift-functional | configure | Create a osrc file
  template:
    src: swift_functional.osrc.j2
    dest: "/tmp/swift_functional.osrc"
    mode: 0400
070701000000F2000081A40000000000000000000000015C7A0D8A00000AB8000000000000000000000000000000000000005600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/tasks/make-testers.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: swift-functional | configure | Get a domain scoped token
  keystone_v3:
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    login_username: "{{ keystone_admin_user }}"
    login_password: "{{ keystone_admin_password }}"
    login_user_domain_name: "Default"
    login_domain_name: "Default"
    action: "token_get"
  register: domain_scoped_token

- name: swift-functional | configure | Create functional test non-member role
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_role"
    role_name: "{{ swift_functional_test_non_operator_role }}"
    description: "Swift functional test non-member role"
  run_once: true

- name: swift-functional | configure | Create functional test projects
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_project"
    project_name: "{{ item.value.project_name }}"
    project_domain_name: "{{ item.value.domain }}"
    description: "Project used by Swift functional tests"
  run_once: true
  with_dict: "{{ swift_functional_test_users }}"

- name: swift-functional | configure | Create functional test users
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_user"
    user_name: "{{ item.key }}"
    user_password: "{{item.value.password }}"
    description: "Swift functional test user"
    user_domain_name: "{{ item.value.domain }}"
  run_once: true
  with_dict: "{{ swift_functional_test_users }}"

- name: swift-functional | configure | Assign roles to users
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "grant_project_role"
    user_name: "{{ item.key }}"
    project_name: "{{ item.value.project_name }}"
    role_name: "{{ item.value.role }}"
    user_domain_name: "{{ item.value.domain }}"
    project_domain_name: "{{ item.value.domain }}"
  run_once: true
  with_dict: "{{ swift_functional_test_users }}"
070701000000F3000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/templates070701000000F4000081A40000000000000000000000015C7A0D8A000005E4000000000000000000000000000000000000006200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/templates/swift_functional.osrc.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.
#
#}
export OS_AUTH_VERSION=3
export OS_AUTH_URL=https://{{ auth_ip }}:{{ auth.port }}/v3
export no_proxy=$no_proxy,{{ auth_ip }},{{ auth.hostname }}
echo "{{ auth_ip }}   {{ auth.hostname }}" | sudo tee -a /etc/hosts

# Pick user...
export OS_USERNAME=swf_func_tester
export OS_PASSWORD={{ swift_functional_test_users.swf_func_tester.password }}
export OS_PROJECT_NAME={{ swift_functional_test_users.swf_func_tester.project_name }}

# Or...
# export OS_USERNAME=swf_func_tester2
# export OS_PASSWORD={{ swift_functional_test_users.swf_func_tester2.password }}
# export OS_PROJECT_NAME={{ swift_functional_test_users.swf_func_tester2.project_name }}

# Or...
# export OS_USERNAME=swf_func_tester3
# export OS_PASSWORD={{ swift_functional_test_users.swf_func_tester3.password }}
# export OS_PROJECT_NAME={{ swift_functional_test_users.swf_func_tester3.project_name }}

070701000000F5000081A40000000000000000000000015C7A0D8A00000983000000000000000000000000000000000000005600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-functional/templates/test.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.
#
#}
#
# Instructions:
#
# - Checkout swift repo on a test server
#
# - Copy this file to /tmp/test.conf
#
# - If you have SSL cert setup, edit the "insecure" option below
#
# - Test your general environment as follows:
#
#   (a) Copy the /tmp/swift_functional.osrc to your test server
#       and run it (this edits /etc/hosts and rewrites no_proxy
#       environment variable)
#
#   (b) Use swift CLI as follows. Remove the --insecure if you gave setup
#       SSL certs.
#
#       swift --insecure stat -v
#
#       You should expect it to show the account metadata. The -v means it
#       also prints the Swift endpoint and token.
#
# - In top level swift directory, run the following commands to run the
#   functional tests:
#       export PYTHONWARNINGS="ignore:A true SSLContext object is not available,ignore:Unverified HTTPS request is being made"
#       tox -e func
#
[func_test]

# Functional tests do not support endpoint type -- hence
# we use the external VIP for auth since we use the external
# endpoint anyway.
auth_host = {{ auth_ip }}
# For /etc/hosts:-   {{ auth_ip }}   {{ auth.hostname }}
{% if auth.scheme == "https" %}
auth_ssl = yes
{% else %}
auth_ssl = no
{% endif %}

# Change this if using certs
insecure = yes

auth_version = 3
auth_port = 5000
auth_prefix = /v3/

account = {{ swift_functional_test_users.swf_func_tester.project_name }}
username = swf_func_tester
password = {{ swift_functional_test_users.swf_func_tester.password }}

account2 = {{ swift_functional_test_users.swf_func_tester2.project_name }}
username2 = swf_func_tester2
password2 = {{ swift_functional_test_users.swf_func_tester2.password }}

username3 = swf_func_tester3
password3 = {{ swift_functional_test_users.swf_func_tester3.password }}

collate = C


[unit_test]
fake_syslog = False
070701000000F6000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000003C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor070701000000F7000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/defaults070701000000F8000081A40000000000000000000000015C7A0D8A0000045F000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/defaults/main.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
keystone_url: "{{ keystone_auth_url }}/v3"
keystone_user: "{{ KEY_API.vars.keystone_admin_user }}"
keystone_password: "{{ KEY_API.vars.keystone_admin_pwd | quote }}"
keystone_project: "{{ KEY_API.vars.keystone_admin_tenant }}"
keystone_project_domain: "Default"
keystone_user_domain: "Default"
system_cacert_file: "{{ trusted_ca_bundle }}"
monasca_alarm_definition_api_url: "{{ MON_AGN.consumes_MON_API.vips.private[0].url }}/v2.0"
monasca_agent_user: monasca-agent
070701000000F9000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/meta070701000000FA000081A40000000000000000000000015C7A0D8A000002C5000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/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: _SWF-CMN
  - role: swiftlm-uptime-monitor
070701000000FB000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/tasks070701000000FC000081A40000000000000000000000015C7A0D8A000008A0000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/tasks/monasca_agents.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: swift-monitor | monasca_agents | Allow sudo access to swiftlm-scan
  become: yes
  template:
    src: swiftlm-scan-users
    dest: /etc/sudoers.d/swiftlm-scan-users
    owner: root
    group: root
    mode: 0440

# Removing the swift monasca_agent_plugin in favour of the individual httpcheck
# plugins for the swift proxy, account, container and object services. Also,
# the swiftlm_scan plugin has a process check for all swift processes and so
# it is used in favour of the swift monasca_agent_plugin.
# The name value here is the name of Plugin class in the detect modules, not
# the name of the module.
- name: swift-monitor  | monasca_agents | Run Monasca agent Swift detection plugin
  monasca_agent_plugin:
    name=swift
    state=absent

- name: swift-monitor  | monasca_agents | Run swiftlm custom detection plugin
  monasca_agent_plugin:
    name: "SwiftLMDetect"
    # args should be a space separated list and can include:
    #    metrics_files=<comma-separated (no spaces) list of files from
    #                  which metrics will be read.
    #    subcommands=<comma-separated (no spaces) list of subcommands with
    #                which swiftlm-scan will be run.
    #    suppress_ok=<comma-separated (no spaces) list of subcommands for
    #                which swiftlm-scan will not report metrics with value
    #                OK (0).
    args: >
      subcommands={{ swiftlm_check_subcommands }}
      suppress_ok={{ swiftlm_check_suppress_ok }}
      metrics_files={{ swiftlm_check_metrics_files }}
  ignore_errors: yes
070701000000FD000081A40000000000000000000000015C7A0D8A00002C5D000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/tasks/monasca_alarms.yml#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swift-monitor | monasca-alarms | Setup default email notification method
  monasca_notification_method:
    name: "Default Email"
    type: 'EMAIL'
    address: "root@localhost"
    keystone_url: "{{ keystone_url }}"
    keystone_user: "{{ keystone_user }}"
    keystone_password: "{{ keystone_password | quote }}"
    keystone_project: "{{ keystone_project }}"
    keystone_project_domain: "{{ keystone_project_domain }}"
    keystone_user_domain: "{{ keystone_user_domain }}"
    keystone_verify: "{{ system_cacert_file }}"
    monasca_api_url: "{{ monasca_alarm_definition_api_url }}"
    overwrite: false
  register: default_notification
  run_once: true

- name: swift-monitor  | monasca_alarms | Create monasca alarm definitions
  run_once: true
  monasca_alarm_definition:
    name: "{{ item.name }}"
    description: "{{ item.description }}"
    severity: "{{ item.severity }}"
    expression: "{{ item.expression }}"
    match_by: "{{ item.match_by }}"
    keystone_url: "{{ keystone_url }}"
    keystone_user: "{{ keystone_user }}"
    keystone_password: "{{ keystone_password }}"
    keystone_project: "{{ keystone_project }}"
    keystone_project_domain: "{{ keystone_project_domain }}"
    keystone_user_domain: "{{ keystone_user_domain }}"
    keystone_verify: "{{ system_cacert_file }}"
    monasca_api_url: "{{ monasca_alarm_definition_api_url }}"
    ok_actions:
      - "{{ default_notification.notification_method_id }}"
    undetermined_actions:
      - "{{ default_notification.notification_method_id }}"
    alarm_actions:
      - "{{ default_notification.notification_method_id }}"
  with_items:
    - { name: "swiftlm-scan monitor",
        description: "Alarms if swiftlm-scan cannot execute a monitoring task",
        severity: "HIGH",
        expression: "swiftlm.swiftlm_check > 1",
        match_by: ["hostname"]}

    - { name: "Swift configuration file ownership",
        description: "Alarms if files/directories in /etc/swift are not owned by Swift.",
        severity: "HIGH",
        expression: "swiftlm.swift.file_ownership.config > 1",
        match_by: ["hostname"]}

    - { name: "Swift data filesystem ownership",
        description: "Alarms if files/directories in /srv/node are not owned by Swift.",
        severity: "HIGH",
        expression: "swiftlm.swift.file_ownership.data > 1",
        match_by: ["hostname"]}

    - { name: "Drive URE errors detected",
        description: "Alarms if swift-drive-audit reports a unrecoverable read error on a drive used by Swift",
        severity: "HIGH",
        expression: "swiftlm.swift.drive_audit > 1",
        match_by: ["hostname", "mount_point"]}

    - { name: "Swift service",
        description: "Alarms if a Swift process is not running.",
        severity: "HIGH",
        expression: "swiftlm.swift.swift_services > 1",
        match_by: ["hostname", "component"]}

    - { name: "Swift filesystem mount point status",
        description: "Alarms if a filesystem/drive used by Swift in not correctly mounted",
        severity: "HIGH",
        expression: "swiftlm.systems.check_mounts > 1",
        match_by: ["hostname", "mount"]}

    - { name: "Swift Keystone server connect",
        description: "Alarms if a socket cannot be opened to the Keystone service (used for token validation)",
        severity: "HIGH",
        expression: "swiftlm.systems.connectivity.connect_check > 1",
        match_by: ["url"]}

    - { name: "Swift memcached server connect",
        description: "Alarms if a socket cannot be opened to the specified memcached server",
        severity: "HIGH",
        expression: "swiftlm.systems.connectivity.memcache_check > 1",
        match_by: ["url"]}

    - { name: "Swift rsync server connect",
        description: "Alarms if a socket cannot be opened to the specified rsync server",
        severity: "HIGH",
        expression: "swiftlm.systems.connectivity.rsync_check > 1",
        match_by: ["url"]}

    - { name: "Swift rings checksum",
        description: "Alarms if the swift rings checksums do not match on all hosts",
        severity: "HIGH",
        expression: "swiftlm.md5sum.cp.check.ring_checksums > 1",
        match_by: ["control_plane", "cloud_name"]}

    - { name: "Swift account replicator last completed in 12 hours",
        description: "Alarms if a swift account replicator has not completed in 12 hours",
        severity: "MEDIUM",
        expression: "swiftlm.replication.cp.max.account_last > {{ 60 * 60 * 12 }}",
        match_by: ["control_plane", "cloud_name"]}

    - { name: "Swift container replicator last completed in 12 hours",
        description: "Alarms if a swift container replicator has not completed in 12 hours",
        severity: "MEDIUM",
        expression: "swiftlm.replication.cp.max.container_last > {{ 60 * 60 * 12 }}",
        match_by: ["control_plane", "cloud_name"]}

    - { name: "Swift object replicator last completed in 24 hours",
        description: "Alarms if a swift object replicator has not completed in 24 hours",
        severity: "MEDIUM",
        expression: "swiftlm.replication.cp.max.object_last > {{ 60 * 60 * 24 }}",
        match_by: ["control_plane", "cloud_name"]}

    # The following 2 alarms are used to detect when an individual swift
    # filesystem exceeds a certain usage level e.g. 80% is a MEDIUM alarm and
    # 90% is a HIGH alarm. Note the metric is a host rather than aggregated
    # cp metric
    - { name: "Swift individual disk usage exceeds 80%",
        description: "Alarms if the swift individual disk usage exceeds the 80%",
        severity: "MEDIUM",
        expression:
          "swiftlm.diskusage.host.max.usage > 80 and swiftlm.diskusage.host.max.usage <= 90",
        match_by: ["hostname"]}

    - { name: "Swift individual disk usage exceeds 90%",
        description: "Alarms if the swift individual disk usage usage exceeds 90%",
        severity: "HIGH",
        expression: "swiftlm.diskusage.host.max.usage > 90",
        match_by: ["hostname"]}

    # The following 2 alarms are used to detect when the average of all swift
    # filesystems exceeds a certain usage level e.g. 80% is a MEDIUM alarm and
    # 90% is a HIGH alarm. This should equate to alarming when the total used
    # storage exceeds 80% and 90%.
    - { name: "Swift total disk usage exceeds 80%",
        description: "Alarms if the swift total disk usage exceeds 80%",
        severity: "MEDIUM",
        expression: "swiftlm.diskusage.cp.avg.usage > 80 and swiftlm.diskusage.cp.avg.usage <= 90",
        match_by: ["control_plane", "cloud_name"]}

    - { name: "Swift total disk usage exceeds 90%",
        description: "Alarms if the swift total disk usage exceeds 90%",
        severity: "HIGH",
        expression: "swiftlm.diskusage.cp.avg.usage > 90",
        match_by: ["control_plane", "cloud_name"]}

    # OpsConsole uses this to alarm the 24hour availability panel. we use the
    # avail_minute metric even through the panel shows the value for avail_day.
    # The reason is that an outage will take up to 24 hours to bring the
    # availability back to 100%, but we don't to alarm the operator when the
    # system is *now* back to normal.
    - { name: "Swift service per-minute availability",
        description: "Alarms if the swift service reports unavailable for the previous minute",
        severity: "HIGH",
        expression: "swiftlm.umon.target.val.avail_minute < 100",
        match_by: ["control_plane", "cloud_name"]}

    - { name: "Swift uptime-monitor status",
        description: "Alarms if the swiftlm-uptime-monitor has errors using Keystone (keystone-get-token), Swift (rest-api) or Swift's healthcheck.",
        severity: "HIGH",
        expression: "swiftlm.umon.target.check.state > 1",
        match_by: ["control_plane", "cloud_name", "url", "component"]}

    # These alarms check the status of various components of the system

    - { name: "Swift smart array controller status",
        description: "Alarms if there is a failure in the Smart Array.",
        severity: "HIGH",
        expression: "swiftlm.hp_hardware.ssacli.smart_array > 1",
        match_by: ["hostname", "controller_slot", "component", "sub_component"] }

    - { name: "Swift physical drive status",
        description: "Alarms if there is a failure in the Physical Drive.",
        severity: "HIGH",
        expression: "swiftlm.hp_hardware.ssacli.physical_drive > 1",
        match_by: ["box", "bay", "hostname"]}

    - { name: "Swift logical drive status",
        description: "Alarms if there is a failure in the Logical Drive.",
        severity: "HIGH",
        expression: "swiftlm.hp_hardware.ssacli.logical_drive > 1",
        match_by: ["hostname", "logical_drive"]}

    - { name: "Swift service listening on ip and port",
        description: "Alarms if a swift service is listening on the wrong ip or port.",
        severity: "HIGH",
        expression: "swiftlm.swift.swift_services.check_ip_port > 1",
        match_by: ["hostname", "component"]}

  # Old alarms need to be removed for two reasons:
  # - We no longer want an alarm
  # - The alarm expression changes. The only way to do this is to delete the
  #   original alarm (here) and change the alarm name (above). Most alarms
  #   here fall into this category
  #   Note: you must do this for each released version. However mid-development
  #   changes can simply be made above since they do not need to be upgradeable.
- name: swift-monitor  | monasca_alarms | Remove old monasca alarm definitions
  run_once: true
  monasca_alarm_definition:
    name: "{{ item.name }}"
    state: "{{ item.state }}"
    keystone_url: "{{ keystone_url }}"
    keystone_user: "{{ keystone_user }}"
    keystone_password: "{{ keystone_password }}"
    keystone_project: "{{ keystone_project }}"
    keystone_project_domain: "{{ keystone_project_domain }}"
    keystone_user_domain: "{{ keystone_user_domain }}"
    keystone_verify: "{{ system_cacert_file }}"
    monasca_api_url: "{{ monasca_alarm_definition_api_url }}"
  with_items:
    - { name: "Swift host ping",
        state: "absent"}
    - { name: "Swift memcache connect",
        state: "absent"}
    - { name: "Swift services",
        state: "absent"}
    - { name: "Drive URE errors",
        state: "absent"}
    - { name: "Swift host socket connect",
        state: "absent"}
    - { name: "Swift host socket connect",
        state: "absent"}
    - { name: "Swift rsync connect",
        state: "absent"}
    - { name: "Swift filesystem mount status",
        state: "absent"}
    - { name: "Swift file ownership",
        state: "absent"}
    - { name: "Swift smart array status",
        state: "absent"}
070701000000FE000081A40000000000000000000000015C7A0D8A00000A19000000000000000000000000000000000000005D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/tasks/monasca_custom_plugins.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.
#
---
#
# Installs custom plugin modules for monasca agent if any are defined.
# NB after these tasks, monasca_setup should be run to detect the
# installed plugins.
#

# Find custom detect modules
- name: swift-monitor  | monasca_custom_plugins | Find monasca custom detect plugins
  command: find {{ detect_plugins_src }} -maxdepth 1 -type f -name *.py ! -name __init__.py
  register: detect_plugins
  ignore_errors: yes

# Find custom check modules
- name: swift-monitor  | monasca_custom_plugins | Find monasca custom check plugins
  command: find {{ check_plugins_src }} -maxdepth 1 -type f -name *.py ! -name __init__.py
  register: check_plugins
  ignore_errors: yes

# Create monasca agent dirs in /usr/lib (if necessary)
- name: swift-monitor  | monasca_custom_plugins | Create dirs for installing monasca custom check plugins
  file:
    path: "{{ item }}"
    state: directory
    mode: "u=rwx,g=rx,o=rx"
  with_items:
    - "{{ monasca_agent_detection_plugin_dir }}"
    - "{{ monasca_agent_check_plugin_dir }}"
  when: check_plugins.stdout != "" and detect_plugins.stdout != ""

# symlink to custom detect modules
- name: swift-monitor  | monasca_custom_plugins | Install swiftlm custom monasca detect plugins
  file:
    src: "{{ item }}"
    dest: "{{ monasca_agent_detection_plugin_dir }}{{ item | basename }}"
    owner: root
    group: root
    state: link
    mode: "u=rw,g=r,o=r"
  with_items:
    - "{{ detect_plugins.stdout_lines }}"
  when: check_plugins.stdout != "" and detect_plugins.stdout != ""

# symlink to custom check modules
- name: swift-monitor  | monasca_custom_plugins | Install swiftlm custom monasca check plugins
  file:
    src: "{{ item }}"
    dest: "{{ monasca_agent_check_plugin_dir }}{{ item | basename }}"
    owner: root
    group: root
    state: link
    mode: "u=rw,g=r,o=r"
  with_items:
    - "{{ check_plugins.stdout_lines }}"
  when: check_plugins.stdout != "" and detect_plugins.stdout != ""
070701000000FF000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/templates07070100000100000081A40000000000000000000000015C7A0D8A000002F3000000000000000000000000000000000000005900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/templates/swiftlm-scan-users{#
# (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.
#}
User_Alias SWIFTLM_USERS = {{ monasca_agent_user }}
SWIFTLM_USERS ALL=(ALL) NOPASSWD: /usr/local/bin/swiftlm-scan
07070100000101000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/vars07070100000102000081A40000000000000000000000015C7A0D8A000006F6000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-monitor/vars/main.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
#
# Define vars used during monasca custom agent install
#
project: swiftlm

project_src: "{% if deployer_media_legacy_layout|bool -%}
                  /opt/stack/service/{{ project }}/venv/lib/python2.7/site-packages/{{ project }}
              {%- else -%}
                  /usr/lib/python2.7/site-packages/{{ project }}/
              {%- endif -%}"

# path where custom detect plugin(s) may be found (a valid path for 'find')
detect_plugins_src: "{{ project_src }}/monasca/detect_plugins"

# path where custom check plugin(s) may be found (a valid path for 'find')
check_plugins_src: "{{ project_src }}/monasca/check_plugins"

#
# Define vars used during monasca custom agent configuration
#

# Default list of files from which swiftlm_check will read metrics.
swiftlm_check_metrics_files: ""

# Default list of subcommands that swiftlm_check will use with swiftlm-scan.
# Note: this list must NOT contain whitespace
swiftlm_check_subcommands: ""

# Default list of subcommands for which swiftlm_check not report measurements
# with value OK (0).
# Note: this list must NOT contain whitespace
swiftlm_check_suppress_ok: ""
07070100000103000041ED0000000000000000000000065C7A0D8A00000000000000000000000000000000000000000000004300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure07070100000104000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/defaults07070100000105000081A40000000000000000000000015C7A0D8A0000053B000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/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.
#
---

keystone_admin_user: "{{ KEY_API.vars.keystone_admin_user }}"
keystone_admin_password: "{{ KEY_API.vars.keystone_admin_pwd | quote }}"
keystone_default_domain: "{{ KEY_API.vars.keystone_default_domain }}"
keystone_admin_endpoint: "{{ keystone_auth_url }}"
keystone_service_project_name: "{{ KEY_API.vars.keystone_service_tenant }}"
keystone_admin_role: "{{ KEY_API.vars.keystone_admin_role }}"
keystone_user_domain_name: "{{ keystone_default_domain }}"
keystone_project_domain_name: "{{ keystone_default_domain }}"
keystone_region : "{{ KEY_API.advertises.vips.public[0].region_name }}"

swift_member_role: Member
swift_operator_role: swiftoperator
swift_reseller_admin_role: ResellerAdmin
07070100000106000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/meta07070100000107000081A40000000000000000000000015C7A0D8A000002A4000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/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: _SWF-CMN
07070100000108000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/tasks07070100000109000081A40000000000000000000000015C7A0D8A0000090B000000000000000000000000000000000000006100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/tasks/keystone_change_pwd.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: swift-post-configure | keystone_change_pw | Get a domain scoped token
  keystone_v3:
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    login_username: "{{ keystone_admin_user }}"
    login_password: "{{ keystone_admin_password }}"
    login_user_domain_name: "{{ keystone_default_domain }}"
    login_domain_name: "{{ keystone_default_domain }}"
    action: "token_get"
  register: domain_scoped_token

- name: swift-post-configure | keystone_change_pw | Update swift user password
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "reset_password_by_admin"
    user_name: "{{ swift_user_name }}"
    user_password: "{{ swift_user_password }}"
    user_domain_name: "{{ keystone_user_domain_name }}"
  run_once: true

- name: swift-post-configure | keystone_change_pw | Update Swift Monitor user password
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "reset_password_by_admin"
    user_name: "{{ swift_monitor_user }}"
    user_password: "{{ swift_monitor_password }}"
    user_domain_name: "{{ keystone_user_domain_name }}"
  run_once: true

- name: swift-post-configure | keystone_change_pw | Update Swift Dispersion user password
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "reset_password_by_admin"
    user_name: "{{ swift_dispersion_user }}"
    user_password: "{{ swift_dispersion_password }}"
    user_domain_name: "{{ keystone_user_domain_name }}"
  run_once: true

0707010000010A000081A40000000000000000000000015C7A0D8A00001885000000000000000000000000000000000000005B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/tasks/keystone_conf.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- name: swift-post-configure | keystone_conf | Get a domain scoped token
  keystone_v3:
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    login_username: "{{ keystone_admin_user }}"
    login_password: "{{ keystone_admin_password }}"
    login_user_domain_name: "{{ keystone_default_domain }}"
    login_domain_name: "{{ keystone_default_domain }}"
    action: "token_get"
  register: domain_scoped_token

- name: swift-post-configure | keystone_conf | Create Swift Service User in service tenant
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_user"
    user_name: "{{ swift_user_name }}"
    user_password: "{{ swift_user_password }}"
    description: "Swift service user"
    user_domain_name: "{{ keystone_user_domain_name }}"
  run_once: true

- name: swift-post-configure | keystone_conf | Grant the admin role to swift user
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "grant_project_role"
    user_name: "{{ swift_user_name }}"
    project_name: "{{ keystone_service_project_name }}"
    role_name: "{{ keystone_admin_role }}"
    user_domain_name: "{{ keystone_user_domain_name }}"
    project_domain_name: "{{ keystone_project_domain_name }}"
  run_once: true

# Temporary hack to allow replacing the role Member in the model with
# _member_
- name: swift-post-configure | keystone_conf | Create role Member
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_role"
    role_name: "{{ swift_member_role }}"
    description: "Swift Member role"
  run_once: true

- name: swift-post-configure | keystone_conf | Create role swiftoperator
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_role"
    role_name: "{{ swift_operator_role }}"
    description: "Swift operator role"
  run_once: true

- name: swift-post-configure | keystone_conf | Create role ResellerAdmin
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_role"
    role_name: "{{ swift_reseller_admin_role }}"
    description: "Swift reseller admin role"
  run_once: true

- name: swift-post-configure | keystone_conf | Create Swift Monitor tenant
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_project"
    project_name: "{{ swift_monitor_tenant }}"
    project_domain_name: "{{ keystone_project_domain_name }}"
    description: "Swift monitor project"
  run_once: true

- name: swift-post-configure | keystone_conf | Create Swift Monitor user
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_user"
    user_name: "{{ swift_monitor_user }}"
    user_password: "{{ swift_monitor_password }}"
    description: "Swift monitor user"
    user_domain_name: "{{ keystone_user_domain_name }}"
  run_once: true

- name: swift-post-configure | keystone_conf | Assign admin to Swift Monitor user
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "grant_project_role"
    user_name: "{{ swift_monitor_user }}"
    project_name: "{{ swift_monitor_tenant }}"
    role_name: "admin"
    user_domain_name: "{{ keystone_user_domain_name }}"
    project_domain_name: "{{ keystone_project_domain_name }}"
  run_once: true

- name: swift-post-configure | keystone_conf | Create Swift Dispersion tenant
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_project"
    project_name: "{{ swift_dispersion_tenant }}"
    project_domain_name: "{{ keystone_project_domain_name }}"
    description: "Swift dispersion project"
  run_once: true

- name: swift-post-configure | keystone_conf | Create Swift Dispersion user
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "create_user"
    user_name: "{{ swift_dispersion_user }}"
    user_password: "{{ swift_dispersion_password }}"
    description: "Swift dispersion user"
    user_domain_name: "{{ keystone_user_domain_name }}"
  run_once: true

- name: swift-post-configure | keystone_conf | Assign admin to Swift Dispersion user
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    action: "grant_project_role"
    user_name: "{{ swift_dispersion_user }}"
    project_name: "{{ swift_dispersion_tenant }}"
    role_name: "admin"
    user_domain_name: "{{ keystone_user_domain_name }}"
    project_domain_name: "{{ keystone_project_domain_name }}"
  run_once: true

# NOTE(gyee): we assume SES is enabled for Swift if 'ses_radosgw_url' is
# defined
- name: swift-post-configure | keystone_conf |
        Update Swift endpoints if SES is enabled
  become: yes
  keystone_v3:
    login_token: "{{ domain_scoped_token.result }}"
    endpoint: "{{ keystone_admin_endpoint }}/v3"
    admin_url: "{{ ses_radosgw_url }}"
    internal_url: "{{ ses_radosgw_url }}"
    public_url: "{{ ses_radosgw_url }}"
    service_name: "swift"
    action: "create_endpoint"
  when: ses_radosgw_url is defined
  run_once: true
0707010000010B000081A40000000000000000000000015C7A0D8A0000036A000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/tasks/swiftlm.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: swift-post-configure | swiftlm | Copy swiftlm-scan.conf
  template:
    src: swiftlm-scan.conf.j2
    dest: "{{ swiftlm_dir }}/swiftlm-scan.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
0707010000010C000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/templates0707010000010D000081A40000000000000000000000015C7A0D8A00000668000000000000000000000000000000000000006200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swift-post-configure/templates/swiftlm-scan.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 Swift 
# service.
# You may make changes to this file by adding sections/options below.

[DEFAULT]
swift_proxy_server = {{ swift_proxy_server_role }}
swift_account_server = {{ swift_account_server_role }}
swift_container_server = {{ swift_container_server_role }}
swift_object_server = {{ swift_object_server_role }}
swift_mount_point = {{ swift_devices }}

[network-interface]
{% if host.bind.SWF_PRX is defined %}
proxy_bind_ip = {{ proxy_bind_ip }}
{% endif %}
{% if host.bind.SWF_ACC is defined %}
account_bind_ip = {{ account_bind_ip }}
{% endif %}
{% if host.bind.SWF_CON is defined %}
container_bind_ip = {{ container_bind_ip }}
{% endif %}
{% if host.bind.SWF_OBJ is defined %}
object_bind_ip = {{ object_bind_ip }}
{% endif %}
{% if host.bind.SWF_RSY is defined %}
rsync_bind_ip = {{ rsync_bind_ip }}
{% endif %}

[rsync-target]
{% if host.bind.SWF_RSY is defined %}
rsync_bind_port = {{ rsync_bind_port }}
{% endif %}
0707010000010E000041ED0000000000000000000000065C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate0707010000010F000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/defaults07070100000110000081A40000000000000000000000015C7A0D8A000002D3000000000000000000000000000000000000005200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/defaults/main.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

swiftlm_aggregated_metrics: "{{ swiftlm_cache_path }}/aggregated_metrics.json"
07070100000111000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/meta07070100000112000081A40000000000000000000000015C7A0D8A000002A4000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/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: _SWF-CMN
07070100000113000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/tasks07070100000114000081A40000000000000000000000015C7A0D8A00000350000000000000000000000000000000000000005400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/tasks/configure.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: swiftlm-aggregate | configure | Copy /etc/cron.d/swiftlm-aggregate
  template:
    src: swiftlm-aggregate.j2
    dest: /etc/cron.d/swiftlm-aggregate
    owner: root
    group: root
    mode: 0644
07070100000115000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/templates07070100000116000081A40000000000000000000000015C7A0D8A00000365000000000000000000000000000000000000005F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-aggregate/templates/swiftlm-aggregate.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.
#
#}
# Cronjob to gather aggregated swift-recon data.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
*/1 * * * * root swiftlm-aggregate --metrics {{ swiftlm_aggregated_metrics }} --all

07070100000117000041ED0000000000000000000000035C7A0D8A00000000000000000000000000000000000000000000004000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-provision07070100000118000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-provision/tasks07070100000119000081A40000000000000000000000015C7A0D8A0000071E000000000000000000000000000000000000005900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-provision/tasks/install-legacy.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swiftlm-provision | install | Update venv cache
  become: yes
  install_package:
    cache: update

# This service is used to mount the swift specific filesystems on a server
# on boot. There is no need to postpone activating the updated service, there
# is no start ansible fot this service. If the swiftlm venv package changes
# there is no need to notify a handler. On next reboot, the service will use
# the correct venv.
- name: swiftlm-provision | install | Create swiftlm-mount service
  install_package:
    name: swiftlm
    service: swiftlm-mount
    state: present
  register: swiftlm_provision_install_result

- name: swiftlm-provision | install | Register the swiftlm-mount systemd service
  setup_systemd:
    service: swiftlm-mount
    cmd: swiftlm-drive-provision
    user: root
    group: root
    args: "--mount"
  when: swiftlm_provision_install_result.changed

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: swiftlm-provision | install | Enable the swiftlm-mount service to start on boot
  command: systemctl reenable swiftlm-mount
0707010000011A000081A40000000000000000000000015C7A0D8A0000054E000000000000000000000000000000000000005200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-provision/tasks/install.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swiftlm-provision | install | Update venv cache (legacy)
  include: install-legacy.yml
  when: deployer_media_legacy_layout|bool

- name: swiftlm-provision | install | Create swiftlm-mount service (rpm)
  become: yes
  package:
    name: ardana-swiftlm-drive-provision
    state: present
  when: deployer_media_legacy_layout|bool == false

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: swiftlm-provision | install | Enable the swiftlm-drive-provision service to start on boot (rpm)
  command: systemctl reenable swiftlm-drive-provision
  when: deployer_media_legacy_layout|bool == false
0707010000011B000081A40000000000000000000000015C7A0D8A00000283000000000000000000000000000000000000004F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-provision/tasks/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.
#
---
0707010000011C000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor0707010000011D000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/defaults0707010000011E000081A40000000000000000000000015C7A0D8A00000631000000000000000000000000000000000000005800000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/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.
#
---

region_name: "{{ KEY_API.advertises.vips.public[0].region_name }}"
swiftlm_global:
   global:  "{{ global }}"

this_swift_instance: "{{ host.my_dimensions.cloud_name }}/{{ host.my_dimensions.control_plane }}"

# We perform builds on SWF-ACC[0]. However, we make backups on all
# SWF_ACC nodes for two reasons:
# - allows deploy of latest rings even if SWF-ACC[0] is down
# - allows the definition of SWF-ACC[0] to change (e.g., when a cluster
#   is added to the model).
# We need the network-hostnames where rsync runs - hence use consumes relationship
builder_backup_nodes: "{{ SWF_RNG.consumes_SWF_ACC.members.private }}"

optionally_pretend: "{% if pretend_min_part_hours_passed | default(0) | bool %}--pretend-min-part-hours-passed{% endif %}"
optionally_limit_ring: "{% if limit_ring is defined %}--limit-ring {{ limit_ring }}{% endif %}"
optionally_set_detail: "{% if drive_detail | default(0) | bool %}--detail full{% endif %}"
0707010000011F000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/library07070100000120000081ED0000000000000000000000015C7A0D8A00002552000000000000000000000000000000000000006200000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/library/swift_copy_rings.py#!/usr/bin/python
#
# (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.
#
DOCUMENTATION = '''
---
module: swift_copy_rings
short_description: Copy Swift ring files
description:
  - This module copies Swift ring files from a source directory to a
    target directory (usually /etc/swift).
  - It only copies files if they have changed. It determines this by comparing
    sha1 check sums.
  - If the destination directory contains a ring file that is not in the
    source directory, the file is (optionally) removed.
  - The ownership and mode of the files can also be optionally set. It
    sets these attributes whether or not a file is copied.
  - Only ring files are copied (.builder and .ring.gz). The object storage
    policy has special handling. If the source files are called
    object-0.builder or object-0.ring.gz, they are copied to
    object.builder and object.ring.gz (i.e. the "-0" is removed from the name)
  - Ring files in subdirectories (i.e., backups) are also copied.
options:
    src:
        description:
            - Source directory path to copy files from.
        required: true
        default: null
        choices: []
        aliases: []
    dest:
       description:
            - Directory path where files are copied to.
        required: true
        default: null
        choices: []
        aliases: []
    mode:
       description:
            - Mode of file in destination directory
        required: no
        default: null
        choices: []
        aliases: []
    owner:
       description:
            - name of the user that should own the file
        required: no
        default: null
        choices: []
        aliases: []
    group:
       description:
            - name of the group that should own the file
        required: no
        default: null
        choices: []
    remove:
       description:
            - Remove files from destination if not in source
        required: no
        default: no
        choices: []
'''

EXAMPLES = '''
- swift_copy_files src=/etc/d dest=/etc/swift
  remove=no owner=swift group=swift mode=0400
'''

RETURN = '''
changes:
    description: List of actions taken on source files
    returned: success
    type: array
    sample: "['copy /etc/d/account.builder to /etc/swift/account.builder]"
'''

import json
import hashlib
import grp
import pwd
import os
import shutil
import sys
import shlex


RING_NAMES = ['account', 'container', 'object']
COPY_TYPES = ['.ring.gz', '.builder']


def is_bool(value):
    if value.lower() in ['yes', 'true', '1']:
        return True
    return False


def is_ringfile(name):
    prefix_ok = False
    ext_ok = False
    for prefix in RING_NAMES:
        if name.startswith(prefix):
            prefix_ok = True
    for ext in COPY_TYPES:
        if name.endswith(ext):
            ext_ok = True
    return prefix_ok and ext_ok


# The next two functions manage mapping object-0.<ext> in source directory
# to object.<ext> in destination directory. If the ring is not object-0, the
# name is unchanged.
def rm0(name):
    if name.startswith('object-0.'):
        return 'object.' + name[len('object-0.'):]
    else:
        return name


def add0(name):
    if name.startswith('object.'):
        return 'object-0.' + name[len('object.'):]
    else:
        return name


def checksum(dirname, name):
    m = hashlib.sha1()
    filename = os.path.join(os.path.realpath(dirname), name)
    try:
        fd = open(filename, 'r')
        for chunk in fd.read(64*1024):
            m.update(chunk)
        cksum = repr(m.digest())
    except IOError:
        cksum = 0
    return cksum


def remove(actions, dirname, name):
    filename = os.path.join(os.path.realpath(dirname), name)
    os.remove(filename)
    actions.append('remove %s' % filename)


def copy(changes, src, sname, dest,  dname):
    srcname = os.path.join(os.path.realpath(src), sname)
    destname = os.path.join(os.path.realpath(dest), dname)
    shutil.copy(srcname, destname)
    shutil.copystat(srcname, destname)
    changes.append('copy %s to %s' % (srcname, destname))


def set_owner_mode(actions, dirname, name, owner, group, mode):
    filename = os.path.join(os.path.realpath(dirname), name)
    stat = os.stat(filename)
    if owner:
        owner = pwd.getpwnam(owner).pw_uid
        if stat.st_uid == owner:
            owner = -1  # Already same owner
    else:
        owner = -1
    if group:
        group = grp.getgrnam(group).gr_gid
        if stat.st_gid == group:
            group = -1  # Already same group
    if owner >= 0 or group >= 0:
        os.chown(filename, owner, group)
        actions.append('chown %s to %s %s' % (filename, owner, group))
    if mode:
        orig_mode = str(oct(stat.st_mode))[-4:]
        if mode != orig_mode:
            os.chmod(filename, int(mode, 8))
            actions.append('chmod %s to %s' % (filename, mode))


def main():
    dest_files = []
    src = ''
    dest = ''
    ret = {}
    owner = None
    group = None
    mode = None
    do_removes = False
    changes = []
    file_actions = []
    try:
        args_file = sys.argv[1]
        args_data = file(args_file).read()
        arguments = shlex.split(args_data)
    except (IndexError, IOError):
        arguments = sys.argv  # Running interactively

    try:
        for arg in arguments:
            if "=" in arg:
                (key, value) = arg.split('=')
                if key == 'src':
                    src = value
                elif key == 'dest':
                    dest = value
                elif key == 'remove':
                    do_removes = is_bool(value)
                elif key == 'owner':
                    owner = value
                elif key == 'group':
                    group = value
                elif key == 'mode':
                    mode = value
                else:
                    raise Exception('Invalid argument: %s' % key)  # noqa

        # Find files in src and dest directories
        src_file_names = []
        for _, _, files in os.walk(os.path.realpath(src), topdown=True):
            src_file_names = files
            break
        dest_file_names = []
        for _, _, files in os.walk(os.path.realpath(dest), topdown=True):
            dest_file_names = files
            break

        # Compare files and work out actions for each file. Actions are:
        # same: files are same; no action needed
        # copy: files are different, or missing in dest; copy src to dest
        # remove: file in dest, but not src; remove file from dest
        no_ringfiles = True
        for name in src_file_names:
            if is_ringfile(name):
                no_ringfiles = False
                src_checksum = checksum(src, name)
                if rm0(name) in dest_file_names:
                    dest_checksum = checksum(dest, rm0(name))
                else:
                    dest_checksum = 0  # dest is missing
                if src_checksum == dest_checksum:
                    # src/dest are same checksum
                    file_actions.append({'name': name, 'action': 'same'})
                else:
                    # src/dest different, or missing from dest
                    file_actions.append({'name': name, 'action': 'copy'})
                dest_files.append(name)
        if no_ringfiles:
            raise Exception('No ring files in %s' % src)  # noqa
        for name in dest_file_names:
            if is_ringfile(name):
                if add0(name) not in src_file_names:
                    # dest file no longer in src
                    if do_removes:
                        file_actions.append({'name': name, 'action': 'remove'})
                    else:
                        file_actions.append({'name': name, 'action': 'left'})

        # Perform copy/remove actions
        for file_action in file_actions:
            name = file_action.get('name')
            action = file_action.get('action')
            if action == 'same':
                pass
            elif action == 'remove':
                remove(changes, dest, rm0(name))
            elif action == 'copy':
                copy(changes, src, name, dest, rm0(name))
                src_checksum = checksum(src, name)
                dest_checksum = checksum(dest, rm0(name))
                if src_checksum != dest_checksum:
                    raise Exception('File %s: post-copy checksums'
                                    ' do not match' % os.path.join(src, name))
            if action in ['same', 'copy', 'left']:
                set_owner_mode(changes, dest, rm0(name), owner, group, mode)

        ret['failed'] = False
        ret['rc'] = 0
    except (IOError, OSError, Exception) as err:  # noqa
        ret['failed'] = True
        ret['rc'] = 1
        ret['msg'] = str(err)

    ret['changes'] = changes
    ret['changed'] = False
    if changes:
        ret['changed'] = True
    print(json.dumps(ret))


if __name__ == '__main__':
    main()
07070100000121000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/meta07070100000122000081A40000000000000000000000015C7A0D8A000002A4000000000000000000000000000000000000005400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/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: _SWF-CMN
07070100000123000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/tasks07070100000124000081A40000000000000000000000015C7A0D8A00000630000000000000000000000000000000000000005C00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/tasks/build-rings.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: swiftlm-ring-supervisor | build-rings | Build ring (make-delta, rebalance)
  command: swiftlm-ring-supervisor
           --make-delta --rebalance
           --cloud {{ host.my_dimensions.cloud_name }}
           --control-plane {{ host.my_dimensions.control_plane }}
           {{ optionally_pretend }}
           {{ optionally_limit_ring }}
  register: report

- name: swiftlm-ring-supervisor | build_rings | Print outcome
  debug: var=report.stdout_lines

- name: swiftlm-ring-supervisor | build_rings | Get changelog date
  command: date +'%s-%Y-%m-%d-%H:%M'
  register: changelog_date

- name: swiftlm-ring-supervisor | build_rings | Save outcome
  template:
    src: "swiftlm-ring-supervisor.changelog.j2"
    dest: "{{ swiftlm_etc }}/{{ this_swift_instance }}/builder_dir/backups/swiftlm-ring-supervisor-{{ changelog_date.stdout }}.changelog"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0400"
07070100000125000081A40000000000000000000000015C7A0D8A00001510000000000000000000000000000000000000005A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/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.
#
---

- name: swiftlm-ring-supervisor | configure | Create swift ring supervisor dirs
  file:
    path: "{{ swiftlm_etc }}/{{ item }}"
    state: directory
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0755
  with_items:
  - "{{ this_swift_instance }}"
  - "{{ this_swift_instance }}/config"
  - "{{ this_swift_instance }}/builder_dir"
  - "{{ this_swift_instance }}/builder_dir/backups"
  - "{{ this_swift_instance }}/deploy_dir"
  - "{{ this_swift_instance }}/deploy_dir//backups"

- name: swiftlm-ring-supervisor | configure | Create input model file
  template:
    src: input-model.j2
    dest: "{{ swiftlm_etc }}/{{ this_swift_instance }}/config/input-model.yml"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0400"

- name: swiftlm-ring-supervisor | configure | Create control plane servers file
  template:
    src: control_plane_servers.j2
    dest: "{{ swiftlm_etc }}/{{ this_swift_instance }}/config/control_plane_servers.yml"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0400"

- name: swiftlm-ring-supervisor | configure | Create consumes file
  template:
    src: swift_ring_builder_consumes.j2
    dest: "{{ swiftlm_etc }}/{{ this_swift_instance }}/config/swift_ring_builder_consumes.yml"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0400"

- name: swiftlm-ring-supervisor | configure | Create configuration_data.yml
  template:
    src: configuration_data.j2
    dest: "{{ swiftlm_etc }}/{{ this_swift_instance }}/config/configuration_data.yml"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0400"

- name: swiftlm-ring-supervisor | configure | Create drive_configurations dirs
  file:
    path: "{{ swiftlm_etc }}/{{ this_swift_instance }}/config/drive_configurations/{{ item }}"
    state: directory
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0755"
  with_items: "{{ swift_storage_servers }}"

- name: swiftlm-ring-supervisor | configure | Create drive configurations file
  template:
    src: drive_configuration.j2
    dest: "{{ swiftlm_etc }}/{{ this_swift_instance }}/config/drive_configurations/{{ item }}/drive_configuration.yml"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0400"
  when: "hostvars['{{ item }}']['ardana_drive_configuration'] is defined"
  with_items: "{{ swift_storage_servers }}"

  # Handle Upgrade Issues
  #
  # In Ardana OpenStack, they are in /etc/swiftlm/<cloud>/<control-plane>/builder_dir
  # Copy the files from the old to new location -- and from now on, ring changes
  # are based on the new location.
  # We don't delete the builder files in the old location (just in case something
  # goes wrong).

  # The "removes" here is effective after the rename task.
  # The rename below is an optimisation, since rsync --update means that
  # an old builder_dir will not overwrite the latest builder_dir files.
  # DO NOT refactor to use rsync module. It cannot be used for this action
- name: swiftlm-ring-supervisor | configure | Move legacy builder files
  command: rsync --archive --update
           {{ swiftlm_etc }}/builder_dir/region-{{ region_name }}/
           {{ swiftlm_etc }}/{{ this_swift_instance }}/builder_dir
  args:
    removes: "{{ swiftlm_etc }}/builder_dir/region-{{ region_name }}/account.builder"
  become: yes

- name: swiftlm-ring-supervisor | configure | Rename legacy builder file directory
  command: mv {{ swiftlm_etc }}/builder_dir {{ swiftlm_etc }}/legacy_builder_dir
  args:
    removes: "{{ swiftlm_etc }}/builder_dir/region-{{ region_name }}/account.builder"
  become: yes

  # Handle old releases -- remove legacy files and directories
  #
  # In Ardana OpenStack, builder_dir and deploy_dir uses a "region" structure

- name: swiftlm-ring-supervisor | configure | Remove legacy files
  file:
      path: "{{ item }}"
      state: absent
  with_items:
    - "{{ swiftlm_etc }}/swift-rings-tarball.tar"
    - "{{ swiftlm_etc }}/deploy_dir/swift-rings-tarball.tar"
    - "{{ swiftlm_etc }}/deploy_dir/swift-rings-tarball.checksum"
    - "{{ swiftlm_etc }}/deploy_dir/swift-rings.checksum"
    - "{{ swiftlm_etc }}/swift_ring_builder_consumes.yml"
    - "{{ swiftlm_etc }}/input-model.yml"
    - "{{ swiftlm_etc }}/hosts.hf"

  # DO NOT refactor to use file: state:absent. It cannot be used for this action

- name: swiftlm-ring-supervisor | configure | Remove legacy drive_configurations
  command: rm -R "{{ swiftlm_etc }}/drive_configurations"
  args:
    removes: "{{ swiftlm_etc }}/drive_configurations"

- name: swiftlm-ring-supervisor | configure | Remove legacy deploy_dir
  command: rm -R "{{ swiftlm_etc }}/deploy_dir"
  args:
    removes: "{{ swiftlm_etc }}/deploy_dir"
07070100000126000081A40000000000000000000000015C7A0D8A000007E0000000000000000000000000000000000000005D00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/tasks/deploy-rings.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.
#
---

# In this task we pull the ring files from all potential builder and backup
# nodes. Hence, we only need one server to be up to get the latest
# version of the rings. If all are down, we continue to use the rings we
# already have (since deploy_dir is unchanged).
# If this is first play after this node is reimaged *and* all builder and
# backups are down, this play will fail when it later attempts to copy files
# to /etc/swift.
# DO NOT refactor to use rsync module. It cannot be used for this action
- name: swiftlm-ring-supervisor | deploy-rings | Pull ring files from builder nodes
  command: rsync --archive --update
           {{ item.host }}::rings/
           {{ swiftlm_etc }}/{{ this_swift_instance }}/deploy_dir
  ignore_errors: yes
  become: yes
  with_items: "{{ builder_backup_nodes }}"

- name: swiftlm-ring-supervisor| deploy-rings | Create final ring destination /etc/swift
  # May already exist
  file:
    path: "{{ swift_dir }}"
    state: directory
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0755"
  become: yes

- name: swiftlm-ring-supervisor | deploy-rings | Copy rings to /etc/swift
  swift_copy_rings:
    src: "{{ swiftlm_etc }}/{{ this_swift_instance }}/deploy_dir"
    dest: "{{ swift_dir }}"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: "0440"
    remove: "yes"
  become: yes



07070100000127000081A40000000000000000000000015C7A0D8A00000554000000000000000000000000000000000000006100000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/tasks/sync_from_backup.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.
#
---

# If the builder node is reimaged, we need the latest version of the builder
# files so that subsequent ring builds work correctly. We need to ignore
# errors here since during initial deploy, there is no backup copy. Also,
# we don't want a play to stop on *this* node because a backup node is down.
# DO NOT refactor to use rsync module. It cannot be used for this action
- name: swiftlm-ring-supervisor | sync_from_backup | Pull files from backup
  command: rsync --archive --no-owner --no-group --update
           --timeout=60 --contimeout=10
           {{ item.host }}::rings/
           {{ swiftlm_etc }}/{{ this_swift_instance }}/builder_dir
  ignore_errors: true
  with_items: "{{ builder_backup_nodes }}"
07070100000128000081A40000000000000000000000015C7A0D8A000004FA000000000000000000000000000000000000005F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/tasks/sync_to_backup.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.
#
---

# Use --no-owner --no-group because we are pushing (remote rsync daemon can't
# keep root ownership).
# The "with_items" means we also rsync to ourselves, but with "--update" we
# don't actually push the files.
# DO NOT refactor to use rsync module. It cannot be used for this action
- name: swiftlm-ring-supervisor | sync_to_backup | Make a backup of builder
  command: rsync --archive --no-owner --no-group --update
           --timeout=60 --contimeout=10
           {{ swiftlm_etc }}/{{ this_swift_instance }}/builder_dir/
           {{ item.host }}::rings
  ignore_errors: true
  with_items: "{{ builder_backup_nodes }}"
07070100000129000081A40000000000000000000000015C7A0D8A0000062E000000000000000000000000000000000000006500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/tasks/validate-input-model.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: swiftlm-ring-supervisor | validate-input-model | Validate input model
  command: swiftlm-ring-supervisor
           --make-delta
           --cloud {{ host.my_dimensions.cloud_name }}
           --control-plane {{ host.my_dimensions.control_plane }}
           --ring-delta /tmp/tmp-ring-delta.yml

- name: swiftlm-ring-supervisor | validate-input-model | Summarise changes
  command: swiftlm-ring-supervisor
           --report
           --cloud {{ host.my_dimensions.cloud_name }}
           --control-plane {{ host.my_dimensions.control_plane }}
           --ring-delta /tmp/tmp-ring-delta.yml
           {{ optionally_limit_ring }}
           {{ optionally_set_detail }}
  register: report

- name: swiftlm-ring-supervisor | validate-input-model | Cleanup
  file:
    path: /tmp/tmp-ring-delta.yml
    state: absent

- name: swiftlm-ring-supervisor | validate-input-model | Print report
  debug: var=report.stdout_lines
0707010000012A000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000005000000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/templates0707010000012B000081A40000000000000000000000015C7A0D8A000002CF000000000000000000000000000000000000006600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/templates/configuration_data.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.
#
#}
---

{{ config_data.SWF | default({"undefined": True}) | to_nice_yaml }}

0707010000012C000081A40000000000000000000000015C7A0D8A00000331000000000000000000000000000000000000006900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/templates/control_plane_servers.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.
#
#}
---
{% if control_plane_servers | default('-') == '-' %}
control_plane_servers: []
{% else %}
control_plane_servers:
{{ control_plane_servers | to_nice_yaml }}
{% endif %}
0707010000012D000081A40000000000000000000000015C7A0D8A0000034E000000000000000000000000000000000000006700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/templates/drive_configuration.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.
#
#}
---

{% if hostvars[item]['ardana_drive_configuration'] | default('-') == '-' %}
ardana_drive_configuration: []
{% else %}
{{ hostvars[item]['ardana_drive_configuration'] | to_nice_yaml }}
{% endif %}
0707010000012E000081A40000000000000000000000015C7A0D8A000002AD000000000000000000000000000000000000005F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/templates/input-model.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.
#
#}
---
{{ swiftlm_global | to_nice_yaml }}
0707010000012F000081A40000000000000000000000015C7A0D8A000002CC000000000000000000000000000000000000006F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/templates/swift_ring_builder_consumes.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.
#
#}
---

{{ SWF_RNG | default({"SWF_RNG": "undefined"}) | to_nice_yaml }}

07070100000130000081A40000000000000000000000015C7A0D8A000002AC000000000000000000000000000000000000007500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-ring-supervisor/templates/swiftlm-ring-supervisor.changelog.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.
#
#}
{{ report.stdout_lines | join('\n') }}
07070100000131000041ED0000000000000000000000075C7A0D8A00000000000000000000000000000000000000000000004500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor07070100000132000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/defaults07070100000133000081A40000000000000000000000015C7A0D8A0000076E000000000000000000000000000000000000005700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/defaults/main.yml#
# (c) Copyright 2015, 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

swift_component: swiftlm_uptime_monitor

swiftlm_uptime_monitor_restart_required: false

# Default service directories
swiftlm_uptime_monitor_conf_dir: "{{ ('swiftlm-uptime-monitor' | config_dir())  if deployer_media_legacy_layout|bool else '/etc/swiftlm' }}"
object_store_url: "{{ SWF_PRX.advertises.vips.private[0].url }}"
endpoint_type: internalURL

auth_version: 3
# The director which stores file
swiftlm_uptime_monitor_cache_dir: "{{ recon_cache_path }}/swiftlm_uptime_monitor"
swiftlm_uptime_monitor_stats_file: "{{ swiftlm_uptime_monitor_cache_dir }}/uptime.stats"
swiftlm_logs_dir: /var/log/swiftlm

# The main key/value in the swiftlm_uptime_monitor_services dict is currently
# not used.
# cmd          Identifies the name of the binary used when starting the service
# conf         Specifies the name of the conf file to pass on the cmd line
#              when starting the service
# conf_service Specifies the name of the service that contains the conf file
# main         Identifies the "main" swift services. It is currently
#              not used.
swiftlm_uptime_monitor_services:
  swiftlm-uptime-monitor:
    cmd: swiftlm-uptime-mon
    conf: swiftlm-uptime-monitor.conf
    conf_service: swiftlm-uptime-monitor
    main: true
07070100000134000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/handlers07070100000135000081A40000000000000000000000015C7A0D8A00000359000000000000000000000000000000000000005700000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/handlers/main.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swiftlm_uptime_monitor_config_change
  set_fact:
    swiftlm_uptime_monitor_restart_required: true

- name: swiftlm_uptime_monitor_venv_change
  set_fact:
    swiftlm_uptime_monitor_restart_required: true
07070100000136000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004A00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/meta07070100000137000081A40000000000000000000000015C7A0D8A000002A4000000000000000000000000000000000000005300000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/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: _SWF-CMN
07070100000138000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004B00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/tasks07070100000139000081A40000000000000000000000015C7A0D8A00000479000000000000000000000000000000000000005E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/tasks/_check_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.
#
---
# Trigger a service restart if the special
# ardana_notify_swift_restart_required variable was set
- name: swiftlm-uptime-monitor | _check_restart | Check restart notification
  debug:
    msg: "Trigger swiftlm-uptime-monitor service to restart"
  changed_when: true
  when: ardana_notify_swift_restart_required is defined and
        ardana_notify_swift_restart_required.changed
  notify:
    - swiftlm_uptime_monitor_config_change

- name: swiftlm-uptime-monitor | _check_restart |
    Ensure handlers are executed right away
  become: yes
  meta: flush_handlers
0707010000013A000081A40000000000000000000000015C7A0D8A000008BF000000000000000000000000000000000000005900000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/tasks/configure.yml#
# (c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/configure.yml

- name: swiftlm-uptime-monitor | configure | Create directory /var/cache/swift/swiftlm_uptime_monitor
  file:
    path: "{{ swiftlm_uptime_monitor_cache_dir }}"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0755
    state: directory

- name: swiftlm-uptime-monitor | configure | Create swiftlm_logs_dir directory
  file:
    path: "{{ swiftlm_logs_dir }}"
    owner: root
    group: adm
    mode: 0755
    state: directory


- name: swiftlm-uptime-monitor | configure | Copy /etc/swift/swiftlm-uptime-monitor.conf
  template:
    src: swiftlm-uptime-monitor.conf.j2
    dest: "{{ swiftlm_uptime_monitor_conf_dir }}/swiftlm-uptime-monitor.conf"
    owner: "{{ swift_user }}"
    group: "{{ swift_group }}"
    mode: 0400
  notify:
    - swiftlm_uptime_monitor_config_change

# With 'enable' SLES systemctl fails, claiming 'Too many levels of symbolic
# links', if service is already enabled. Using reenable as workaround.
- name: swiftlm-uptime-monitor | configure | Enable the Swiftlm Uptime Monitor service on boot (legacy)
  command: systemctl reenable "{{ item.key }}"
  with_dict: "{{ swiftlm_uptime_monitor_services }}"
  when: deployer_media_legacy_layout|bool

- name: swiftlm-uptime-monitor | configure | Enable the Swiftlm Uptime Monitor service on boot (rpm)
  command: systemctl enable swiftlm-uptime-mon
  when: deployer_media_legacy_layout|bool == false

- name: swiftlm-uptime-monitor | configure | Set Swiftlm Uptime Monitor enabled as host fact
  set_fact:
    swiftlm_uptime_monitor_enabled: true
0707010000013B000081A40000000000000000000000015C7A0D8A0000082A000000000000000000000000000000000000005E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/tasks/install-legacy.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: ../../_SWF-CMN/tasks/install.yml

- name: swiftlm-uptime-monitor | install | Update venv cache (legacy)
  become: yes
  install_package:
    cache: update

- name: swiftlm-uptime-monitor | install | Install Swiftlm Uptime Monitor Services (legacy)
  install_package:
    name: swiftlm
    service: "{{ item.key }}"
    state: present
    activate: act_off
  with_dict: "{{ swiftlm_uptime_monitor_services }}"
  register: swiftlm_uptime_monitor_install_result
  notify: swiftlm_uptime_monitor_venv_change

# Get the swiftlm venv version, it is the same for all swiftlm services.
- name: swiftlm-uptime-monitor | install | Set conf directory for the service (legacy)
  set_fact:
    swiftlm_venv_version: "{{ item.version }}"
  with_items: "{{ swiftlm_uptime_monitor_install_result.results }}"

# Set the conf dir for the latest installed swift venv
- set_fact:
    swiftlm_uptime_monitor_conf_dir: "{{ 'swiftlm-uptime-monitor' |
                                     config_dir(swiftlm_venv_version) }}"

- name: swiftlm-uptime-monitor | install | Register the Swiftlm Uptime Monitor services (legacy)
  setup_systemd:
    service: "{{ item.item.key }}"
    cmd: "{{ item.item.value.cmd }}"
    user: "{{ swift_user }}"
    group: "{{ swift_group }}"
    args: " --config {{ swiftlm_uptime_monitor_conf_dir }}/{{ item.item.value.conf }}"
  when: item.changed
  with_items: "{{ swiftlm_uptime_monitor_install_result.results }}"

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

- name: swiftlm-uptime-monitor | install | Install (legacy)
  include: install-legacy.yml
  when: deployer_media_legacy_layout|bool

- name: swiftlm-uptime-monitor | install | Install Swiftlm Uptime Monitor Services (rpm)
  become: yes
  package:
    name: ardana-swiftlm-uptime-mon
    state: present
  when: deployer_media_legacy_layout|bool == false
0707010000013D000081A40000000000000000000000015C7A0D8A000005C3000000000000000000000000000000000000005500000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/tasks/start.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- include: _check_restart.yml

- name: swiftlm-uptime-monitor | start | Activate the latest install
  install_package:
    name: swiftlm
    service: "{{ item.item.key }}"
    activate: act_on
    version: "{{ item.version }}"
  with_items: swiftlm_uptime_monitor_install_result.results
  when: swiftlm_uptime_monitor_install_result is defined and deployer_media_legacy_layout|bool

- name: swiftlm-uptime-monitor | start | Restart the Swiftlm Uptime Monitor services
  service:
    name: "{{ item.key }}"
    state: restarted
  with_dict: "{{ swiftlm_uptime_monitor_services }}"
  when: swiftlm_uptime_monitor_restart_required

- name: swiftlm-uptime-monitor | start | Start the Swiftlm Uptime Monitor services
  service:
    name: "{{ item.key }}"
    state: started
  with_dict: "{{ swiftlm_uptime_monitor_services }}"
0707010000013E000081A40000000000000000000000015C7A0D8A000002B8000000000000000000000000000000000000005600000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/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: ../../_SWF-CMN/tasks/_service_status.yml
0707010000013F000081A40000000000000000000000015C7A0D8A0000033C000000000000000000000000000000000000005400000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/tasks/stop.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- name: swiftlm-uptime-monitor | stop | Stop the Swiftlm Uptime Monitor services
  service: name={{ item.key }} state=stopped
  with_dict: "{{ swiftlm_uptime_monitor_services }}"
07070100000140000041ED0000000000000000000000025C7A0D8A00000000000000000000000000000000000000000000004F00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/templates07070100000141000081A40000000000000000000000015C7A0D8A000006F9000000000000000000000000000000000000006E00000000ardana-swift-8.0+git.1551502730.f4d219d/roles/swiftlm-uptime-monitor/templates/swiftlm-uptime-monitor.conf.j2{#
#
# (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.
#
#}
[logging]
# You can specify default log routing here if you want:
log_level = info
log_facility = LOG_LOCAL0
log_format = '%(name)s - %(levelname)s : %(message)s'


[latency_monitor]
# Time between each cycle
interval: 60

# Number of operations to make each cycle. Make this larger
# than number of proxy servers
checks_per_interval: 40

# The  directory where the uptime stats are stored
swiftlm_uptime_monitor_cache_dir: {{ swiftlm_uptime_monitor_cache_dir }}

#The file path where the uptime stats are written
cache_file_path: {{ swiftlm_uptime_monitor_stats_file }}

#You must specify both keystone_auth_url and object_store_url
keystone_auth_url: {{ keystone_auth_url }}/v3
object_store_url: {{ object_store_url }}
endpoint_type: {{ endpoint_type }}

# project and user domain names
project_domain_name = {{ keystone_default_domain }}
user_domain_name =  {{ keystone_default_domain }}

# Credential information
user_name: {{ swift_monitor_user }}
password: {{ swift_monitor_password }}
# Figure out how to get project_id, Not mandatory though
project_id:
project_name: {{ swift_monitor_tenant }}
auth_version: {{ auth_version }}
07070100000142000081A40000000000000000000000015C7A0D8A00000736000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/swift-compare-model-rings.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:
  - SWF-ACC
  - SWF-CON
  - SWF-OBJ
  roles:
  - osconfig-probe
  tasks:
    # We install osconfig-probe to allow us to run as early as possible,
    # though in practice osconfig-run.yml will already have run
    # (note: included file uses sudo, do no become:yes here)
  - include: roles/osconfig-probe/tasks/install.yml
  - probe: hostname={{ host.my_ardana_ansible_name }}
    become: yes

- hosts:
  - SWF-ACC
  roles:
  - _SWF-RSY
  - swiftlm-ring-supervisor
  tasks:
    # We needs to install so this play can happen before swift-deploy.yml
  - include: roles/_SWF-CMN/tasks/install.yml
    become: yes
  - include: roles/_SWF-RSY/tasks/configure.yml
    become: yes
  - include: roles/swiftlm-ring-supervisor/tasks/configure.yml
    become: yes

- hosts:
  - SWF-ACC
  roles:
  - _SWF-RSY
  tasks:
    # Do rsync start here in case above play triggers a restart
  - include: roles/_SWF-RSY/tasks/start.yml
    become: yes

- hosts:
  - SWF-ACC--first-member
  roles:
  - swiftlm-ring-supervisor
  tasks:
  - include: roles/swiftlm-ring-supervisor/tasks/sync_from_backup.yml
    become: yes
  - include: roles/swiftlm-ring-supervisor/tasks/validate-input-model.yml
    become: yes
07070100000143000081A40000000000000000000000015C7A0D8A000009FB000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/swift-configure-monasca.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.
#
---

# The monasca agent tasks need to run after swift has started
- hosts: SWF-PRX:SWF-ACC:SWF-CON:SWF-OBJ:&MON-AGN
  no_log: True
  roles:
    - {role: monasca-agent, run_mode: Use}
    - swift-monitor
    - swiftlm-aggregate
    - access-tailer
  tasks:
  - set_fact:
      # Metrics files for the server running the uptime monitor
      metrics_files:
        "{{ swiftlm_uptime_monitor_stats_file }},{{ swiftlm_aggregated_metrics }},{{ access_tailer_metrics }},{{ swiftlm_scan_metrics }}"
    when: swiftlm_uptime_monitor_enabled is defined
  - set_fact:
      # Metrics files for all swift proxy servers except the server running the uptime monitor
      metrics_files:
        "{{ swiftlm_scan_metrics }},{{ access_tailer_metrics }}"
    when: host.bind.SWF_PRX is defined and swiftlm_uptime_monitor_enabled is not defined
  - set_fact:
      # Metrics files for all swift server except the swift proxy servers
      metrics_files:
        "{{ swiftlm_scan_metrics }}"
    when: host.bind.SWF_PRX is not defined

  - include: roles/swift-monitor/tasks/monasca_custom_plugins.yml
    become: yes
  - include: roles/swift-monitor/tasks/monasca_agents.yml
    become: yes
    vars:
      swiftlm_check_metrics_files:
        "{{ metrics_files }}"

- hosts: SWF-PRX:&MON-AGN
  no_log: True
  roles:
    - {role: monasca-agent, run_mode: Use}
    - monasca-alarm-definition
    - swift-monitor
  tasks:
  - include: roles/swift-monitor/tasks/monasca_alarms.yml
    become: yes

- hosts: SWF-PRX:&MON-AGN
  roles:
  - SWF-PRX
  tasks:
  - include: roles/SWF-PRX/tasks/local_monitor.yml

- hosts: SWF-ACC:&MON-AGN
  roles:
  - SWF-ACC
  tasks:
  - include: roles/SWF-ACC/tasks/local_monitor.yml

- hosts: SWF-CON:&MON-AGN
  roles:
  - SWF-CON
  tasks:
  - include: roles/SWF-CON/tasks/local_monitor.yml

- hosts: SWF-OBJ:&MON-AGN
  roles:
  - SWF-OBJ
  tasks:
  - include: roles/SWF-OBJ/tasks/local_monitor.yml
07070100000144000081A40000000000000000000000015C7A0D8A000003AB000000000000000000000000000000000000003900000000ardana-swift-8.0+git.1551502730.f4d219d/swift-deploy.yml#
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---

- include: pbstart.yml
  vars:
    playbook_name: "swift-deploy.yml"

- include: ses-deploy.yml
- include: _swift-install.yml
- include: swift-update-from-model-rebalance-rings.yml
- include: swift-reconfigure.yml

- include: pbfinish.yml
  vars:
    playbook_name: "swift-deploy.yml"
07070100000145000081A40000000000000000000000015C7A0D8A00000348000000000000000000000000000000000000004600000000ardana-swift-8.0+git.1551502730.f4d219d/swift-dispersion-populate.yml#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
---
- hosts: SWF-PRX--first-member
  roles:
  - swift-dispersion
  tasks:
  - include: roles/swift-dispersion/tasks/configure.yml
    become: yes
  - include: roles/swift-dispersion/tasks/populate.yml
07070100000146000081A40000000000000000000000015C7A0D8A0000034B000000000000000000000000000000000000004400000000ardana-swift-8.0+git.1551502730.f4d219d/swift-dispersion-report.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: SWF-PRX--first-member
  roles:
  - swift-dispersion
  tasks:
  - include: roles/swift-dispersion/tasks/configure.yml
    become: yes
  - include: roles/swift-dispersion/tasks/report.yml
07070100000147000081A40000000000000000000000015C7A0D8A0000048E000000000000000000000000000000000000005100000000ardana-swift-8.0+git.1551502730.f4d219d/swift-reconfigure-credentials-change.yml#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017-2018 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

---
- include: ses-reconfigure.yml
- include: _swift-configure.yml

- hosts: SWF-PRX--first-member
  roles:
    - swiftlm-uptime-monitor
  tasks:
    - include: roles/swiftlm-uptime-monitor/tasks/configure.yml
      become: yes

- hosts: SWF-PRX
  roles:
    - swift-post-configure
  # This task should be set to run-once
  tasks:
    - include: roles/swift-post-configure/tasks/keystone_change_pwd.yml
      ansible_python_interpreter: "{{ KEY_CLI.vars.keystone_client_python_interpreter }}"

- include: swift-start.yml
07070100000148000081A40000000000000000000000015C7A0D8A0000030F000000000000000000000000000000000000003E00000000ardana-swift-8.0+git.1551502730.f4d219d/swift-reconfigure.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.
#

---
- include: ses-reconfigure.yml
- include: _swiftlm-provision.yml
- include: _swift-configure.yml
- include: _swift-post-configure.yml
07070100000149000081A40000000000000000000000015C7A0D8A00000287000000000000000000000000000000000000003A00000000ardana-swift-8.0+git.1551502730.f4d219d/swift-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: _swift-schedule-restart.yml

- include: swift-start.yml
0707010000014A000081A40000000000000000000000015C7A0D8A00000605000000000000000000000000000000000000003800000000ardana-swift-8.0+git.1551502730.f4d219d/swift-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: SWF-RSY
  roles:
  - _SWF-RSY
  tasks:
  - include: roles/_SWF-RSY/tasks/start.yml
    become: yes

- hosts: SWF-PRX
  roles:
  - SWF-PRX
  - access-tailer
  tasks:
  - include: roles/SWF-PRX/tasks/start.yml
    become: yes
  - include: roles/access-tailer/tasks/start.yml
    become: yes

- hosts: SWF-ACC
  roles:
  - SWF-ACC
  tasks:
  - include: roles/SWF-ACC/tasks/start.yml
    become: yes

- hosts: SWF-CON
  roles:
  - SWF-CON
  tasks:
  - include: roles/SWF-CON/tasks/start.yml
    become: yes

- hosts: SWF-OBJ
  roles:
  - SWF-OBJ
  tasks:
  - include: roles/SWF-OBJ/tasks/start.yml
    become: yes

- hosts: SWF-OBJ--first-member
  roles:
  - SWF-EXP
  tasks:
  - include: roles/SWF-EXP/tasks/start.yml
    become: yes

- hosts: SWF-PRX--first-member
  roles:
  - swiftlm-uptime-monitor
  tasks:
  - include: roles/swiftlm-uptime-monitor/tasks/start.yml
    become: yes

0707010000014B000081A40000000000000000000000015C7A0D8A000005E0000000000000000000000000000000000000003900000000ardana-swift-8.0+git.1551502730.f4d219d/swift-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: SWF-PRX
  max_fail_percentage: 0
  roles:
  - SWF-PRX
  tasks:
  - include: roles/SWF-PRX/tasks/status.yml
    become: yes

- hosts: SWF-ACC
  max_fail_percentage: 0
  roles:
  - SWF-ACC
  tasks:
  - include: roles/SWF-ACC/tasks/status.yml
    become: yes

- hosts: SWF-CON
  max_fail_percentage: 0
  roles:
  - SWF-CON
  tasks:
  - include: roles/SWF-CON/tasks/status.yml
    become: yes

- hosts: SWF-OBJ
  max_fail_percentage: 0
  roles:
  - SWF-OBJ
  tasks:
  - include: roles/SWF-OBJ/tasks/status.yml
    become: yes

- hosts: SWF-OBJ--first-member
  max_fail_percentage: 0
  roles:
  - SWF-EXP
  tasks:
  - include: roles/SWF-OBJ/tasks/status.yml
    become: yes

- hosts: SWF-PRX--first-member
  max_fail_percentage: 0
  roles:
  - swiftlm-uptime-monitor
  tasks:
  - include: roles/swiftlm-uptime-monitor/tasks/status.yml
    become: yes
0707010000014C000081A40000000000000000000000015C7A0D8A000005FC000000000000000000000000000000000000003700000000ardana-swift-8.0+git.1551502730.f4d219d/swift-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: SWF-RSY
  roles:
  - _SWF-RSY
  tasks:
  - include: roles/_SWF-RSY/tasks/stop.yml
    become: yes

- hosts: SWF-PRX
  roles:
  - SWF-PRX
  - access-tailer
  tasks:
  - include: roles/SWF-PRX/tasks/stop.yml
    become: yes
  - include: roles/access-tailer/tasks/stop.yml
    become: yes

- hosts: SWF-ACC
  roles:
  - SWF-ACC
  tasks:
  - include: roles/SWF-ACC/tasks/stop.yml
    become: yes

- hosts: SWF-CON
  roles:
  - SWF-CON
  tasks:
  - include: roles/SWF-CON/tasks/stop.yml
    become: yes

- hosts: SWF-OBJ
  roles:
  - SWF-OBJ
  tasks:
  - include: roles/SWF-OBJ/tasks/stop.yml
    become: yes

- hosts: SWF-OBJ--first-member
  roles:
  - SWF-EXP
  tasks:
  - include: roles/SWF-EXP/tasks/stop.yml
    become: yes

- hosts: SWF-PRX--first-member
  roles:
  - swiftlm-uptime-monitor
  tasks:
  - include: roles/swiftlm-uptime-monitor/tasks/stop.yml
    become: yes
0707010000014D000081A40000000000000000000000015C7A0D8A000005FF000000000000000000000000000000000000005400000000ardana-swift-8.0+git.1551502730.f4d219d/swift-update-from-model-rebalance-rings.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:
  - SWF-ACC
  - SWF-CON
  - SWF-OBJ
  roles:
  - osconfig-probe
  tasks:
  - probe: hostname={{ host.my_ardana_ansible_name }}
    become: yes

- hosts:
  - SWF-ACC
  roles:
  - _SWF-RSY
  - swiftlm-ring-supervisor
  tasks:
  - include: roles/_SWF-RSY/tasks/configure.yml
    become: yes
  - include: roles/swiftlm-ring-supervisor/tasks/configure.yml
    become: yes

- hosts:
  - SWF-ACC
  roles:
  - _SWF-RSY
  tasks:
    # Do rsync start here in case above play triggers a restart
  - include: roles/_SWF-RSY/tasks/start.yml
    become: yes

- hosts:
  - SWF-ACC--first-member
  roles:
  - swiftlm-ring-supervisor
  tasks:
  - include: roles/swiftlm-ring-supervisor/tasks/sync_from_backup.yml
    become: yes
  - include: roles/swiftlm-ring-supervisor/tasks/build-rings.yml
    become: yes
  - include: roles/swiftlm-ring-supervisor/tasks/sync_to_backup.yml
    become: yes
0707010000014E000081A40000000000000000000000015C7A0D8A0000031A000000000000000000000000000000000000003A00000000ardana-swift-8.0+git.1551502730.f4d219d/swift-upgrade.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.
#
---
#- include: swift-status.yml
- include: ses-deploy.yml
- include: _swift-install.yml
- include: swift-reconfigure.yml
- include: swift-status.yml
0707010000014F000081A40000000000000000000000015C7A0D8A0000036E000000000000000000000000000000000000004300000000ardana-swift-8.0+git.1551502730.f4d219d/swiftlm-uptime-monitor.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: SWF-PRX--first-member
  roles:
  - swiftlm-uptime-monitor
  tasks:
  - include: roles/swiftlm-uptime-monitor/tasks/install.yml
    become: yes
  - include: roles/swiftlm-uptime-monitor/tasks/configure.yml
    become: yes
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!811 blocks
openSUSE Build Service is sponsored by