diff --git a/dac-ansible/README.md b/dac-ansible/README.md index 1802deba..0bcc6986 100644 --- a/dac-ansible/README.md +++ b/dac-ansible/README.md @@ -2,15 +2,26 @@ Install data-acc demo with ansible. It creates a bunch of OpenStack VMs, then uses ansible to install a development data-acc enviroment. -To run this set of playbooks, first we create some VMs in OpenStack. +## Setup + +Install Ansible and the OpenStack SDK, eg in a Python virtual environment: + + virtualenv .venv + . .venv/bin/activate + pip install -U pip + pip install -U ansible openstacksdk + +Pull in Ansible role dependencies: + + ansible-galaxy install -r requirements.yml Source your OpenStack RC, eg: . openrc -Edit create-servers.py to set your NETWORK_NAME and KEYPAIR_NAME and then run: +Create OpenStack VMs: - ./create-servers.py > hosts + ./create-servers.py -k KEYPAIR_NAME -n NETWORK_NAME > hosts Once the VMs are created, you can now use ansible to deploy the dev environment: @@ -33,16 +44,6 @@ Once the ansible has finished, you can login and try a slurm test: squeue scontrol show burstbuffer -## Install notes - -You may find this useful to run the above ansible-playbook command: - - virtualenv .venv - . .venv/bin/activate - pip install -U pip - pip install -U ansible openstacksdk - ansible-galaxy install -r requirements.yml - ## Debugging Guide When trying slurm-test.sh or similar, here are some debugging tips. diff --git a/dac-ansible/create-servers.py b/dac-ansible/create-servers.py index 40d46840..83e8601d 100755 --- a/dac-ansible/create-servers.py +++ b/dac-ansible/create-servers.py @@ -1,13 +1,19 @@ #!/usr/bin/env python import openstack +from optparse import OptionParser +parser = OptionParser() +parser.add_option("-k", "--key", dest="key", + help="SSH key pair name", metavar="KEYPAIR_NAME") +parser.add_option("-n", "--network", dest="network", + help="Network name", metavar="NETWORK_NAME") +(options, args) = parser.parse_args() IMAGE_NAME = "CentOS-7-x86_64-GenericCloud" FLAVOR_NAME = "C1.vss.tiny" -NETWORK_NAME = "WCDC-Data43" -KEYPAIR_NAME = "usual" - +NETWORK_NAME = options.network +KEYPAIR_NAME = options.key def get_connection(): # openstack.enable_logging(debug=True)