From c3924262f0c3d74e0758e951976f7469946938ff Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Mon, 30 Nov 2015 17:04:39 -0500 Subject: [PATCH] Add installation and setup machinery --- README.md => README.rst | 37 +++++++++++++++++++------------------ ansible.cfg | 3 +++ requirements.txt | 4 ++++ setup.cfg | 31 +++++++++++++++++++++++++++++++ setup.py | 19 +++++++++++++++++++ test-requirements.txt | 3 +++ tox.ini | 14 ++++++++++++++ 7 files changed, 93 insertions(+), 18 deletions(-) rename README.md => README.rst (66%) create mode 100644 ansible.cfg create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/README.md b/README.rst similarity index 66% rename from README.md rename to README.rst index 5143d4f63..827aa5882 100644 --- a/README.md +++ b/README.rst @@ -1,4 +1,5 @@ -# tripleo-quickstart +tripleo-quickstart +================== One of the barriers to entry for trying out TripleO and its derivatives has been the relative difficulty in getting an @@ -11,35 +12,35 @@ with CentOS 7 installed, and able to be ssh'd to without password from the machine running ansible. The defaults are meant to "just work", so assuming you -have ansible 2.0 installed it is as easy as: +have Ansible 2.0 installed it is as easy as:: -```bash export TEST_MACHINE='my_test_machine.example.com' ansible-playbook playbooks/quickstart.yml -``` The playbook will output a debug message at the end with instructions to access the deployed undercloud. -If you need to install ansible 2.0, this is what I used in testing: - -```bash - git clone https://github.com/ansible/ansible.git - cd ansible - git checkout v2.0.0-0.6.rc1 - git submodule update --init --recursive - virtualenv .venv --system-site-packages - source .venv/bin/activate -``` - -## Documentation +Documentation +============= More in-depth documentation is a work in progress. Patches welcome! -### Author +To install ``tripleo-quickstart``:: + + pip install git+https://github.com/trown/tripleo-quickstart.git@master#egg=tripleo-quickstart + # tripleo-quickstart requires Ansible 2.0 + pip install git+https://github.com/ansible/ansible.git@v2.0.0-0.6.rc1#egg=ansible + +Playbooks will be located in either ``/usr/local/share/tripleo-quickstart`` or +in ``$VIRTUAL_ENV/usr/local/share/tripleo-quickstart`` if you have installed in +a virtual environment. + +Author +====== John Trowbridge -### Copyright +Copyright +========= Copyright 2015 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 000000000..6ad45d618 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +# Attempt to load custom modules whether it's installed system-wide or from a virtual environment +library = /usr/lib/python2.7/site-packages/tripleo-quickstart/playbooks/library:$VIRTUAL_ENV/lib/python2.7/site-packages/tripleo-quickstart/playbooks/library:playbooks/library \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..da6941d9f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +pbr>=1.6 +# This doesn't really work due to: +# https://bugs.launchpad.net/pbr/+bug/1373623 +git+https://github.com/ansible/ansible.git@v2.0.0-0.6.rc1#egg=ansible \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..47a9d595b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,31 @@ +[metadata] +name = tripleo-quickstart +summary = tripleo-quickstart - Making it easy to get started with tripleo +description-file = + README.rst +author = John Trowbridge +author-email = jtrowbri@redhat.com +home-page = https://github.com/trown/tripleo-quickstart +classifier = + License :: OSI Approved :: Apache Software License + Development Status :: 4 - Beta + Intended Audience :: Developers + Intended Audience :: System Administrators + Intended Audience :: Information Technology + Topic :: Utilities + +[global] +setup-hooks = + pbr.hooks.setup_hook + +[files] +data_files = + usr/local/share/tripleo-quickstart = ansible.cfg + usr/local/share/tripleo-quickstart/playbooks = playbooks/* + +[wheel] +universal = 1 + +[pbr] +skip_authors = True +skip_changelog = True diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..6a931a61c --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +# Copyright Red Hat, Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# 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 setuptools + +setuptools.setup( + setup_requires=['pbr'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..c267099be --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +# ansible-lint is not yet compatible with 2.0 +ansible<2.0 +ansible-lint diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..1c1172543 --- /dev/null +++ b/tox.ini @@ -0,0 +1,14 @@ +[tox] +minversion = 1.6 +envlist = py27 +skipdist = True + +[testenv] +usedevelop = True +install_command = pip install -U {opts} {packages} +setenv = VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/test-requirements.txt + +[testenv:ansible-lint] +whitelist_externals = bash +commands = bash -c "for file in $(ls {toxinidir}/playbooks/*.yml); do ansible-lint $file; done"