Skip to content

Instantly share code, notes, and snippets.

@cschwede
Last active June 15, 2017 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cschwede/7474fd44a5a3e51526e881e51e28576e to your computer and use it in GitHub Desktop.
Save cschwede/7474fd44a5a3e51526e881e51e28576e to your computer and use it in GitHub Desktop.
Testing TripleO with fake external Swift
parameter_defaults:
ExternalPublicUrl: 'http://overcloud-externalswift-0:8080/v1/AUTH_%(tenant_id)s'
ExternalInternalUrl: 'http://overcloud-externalswift-0:8080/v1/AUTH_%(tenant_id)s'
ExternalAdminUrl: 'http://overcloud-externalswift-0:8080'
ExternalSwiftUserTenant: 'service'
SwiftPassword: secret
- hosts: all
sudo: True
remote_user: heat-admin
tasks:
- file: path=/srv/node state=directory owner=swift group=swift
- command: "{{ item }}"
with_items:
- swift-ring-builder /etc/swift/account.builder create 8 1 1
- swift-ring-builder /etc/swift/container.builder create 8 1 1
- swift-ring-builder /etc/swift/object.builder create 8 1 1
- swift-ring-builder /etc/swift/account.builder add r1z1-127.0.0.1:6202/d1 1
- swift-ring-builder /etc/swift/container.builder add r1z1-127.0.0.1:6201/d1 1
- swift-ring-builder /etc/swift/object.builder add r1z1-127.0.0.1:6200/d1 1
- swift-ring-builder /etc/swift/account.builder rebalance
- swift-ring-builder /etc/swift/container.builder rebalance
- swift-ring-builder /etc/swift/object.builder rebalance
- ini_file: dest="/etc/swift/{{ item }}-server.conf" section=DEFAULT option=mount_check value="false"
with_items:
- account
- container
- object
- ini_file:
dest: /etc/swift/proxy-server.conf
section: "pipeline:main"
option: pipeline
value: "catch_errors gatekeeper healthcheck proxy-logging cache authtoken keystone proxy-logging proxy-server"
- ini_file: dest=/etc/swift/proxy-server.conf section="filter:authtoken" option="{{ item.option }}" value="{{ item.value }}"
with_items:
- { option: "auth_uri", value: "http://overcloud-controller-0:5000/" }
- { option: "auth_url", value: "http://overcloud-controller-0:35357/" }
- { option: "password", value: "secret" }
- { option: "auth_plugin", value: "password" }
- { option: "project_domain_id", value: "default" }
- { option: "user_domain_id", value: "default" }
- { option: "project_name", value: "service" }
- { option: "username", value: "swift" }
- service: name={{item}} state=started enabled=yes
with_items:
- memcached
- openstack-swift-account
- openstack-swift-container
- openstack-swift-object
- openstack-swift-proxy
We abuse the overcloud a bit by adding another node, that is basically doing nothing.
Think of it as a plain baremetal machine with nothing except SSH running on it.
1. Copy minimal-swift.yaml and external-swift-config.yaml to the undercloud
2. cp /usr/share/openstack-tripleo-heat-templates/roles_data.yaml .
3. Append a plain simple, unconfigured node to the deployment:
$ cat << EOF >> roles_data.yaml
- name: ExternalSwift
CountDefault: 1
ServicesDefault:
- OS::TripleO::Services::Ntp
- OS::TripleO::Services::Sshd
- OS::TripleO::Services::Securetty
EOF
4. Deploy with
$ openstack overcloud deploy --templates -e /usr/share/openstack-tripleo-heat-templates/environments/swift-external.yaml -e external-swift-config.yaml -r roles_data.yaml
5. Get the IP for the externalswift node from "nova list"
$ export SWIFTIP=`nova list | grep externalswift | grep -oe "ctlplane=[0-9\.]*" | cut -f 2 -d "="`
6. Add an entry for that host to your undercloud's hosts:
$ echo "${SWIFTIP} overcloud-externalswift-0" | sudo tee -a /etc/hosts
7. Run the attached Ansible playbook to configure a minimal usable "external" Swift fake deployment:
$ ansible-playbook minimal-swift.yaml -i "${SWIFTIP},"
Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment