diff options
Diffstat (limited to 'src/three-minute-demo/README.rst')
-rw-r--r-- | src/three-minute-demo/README.rst | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/three-minute-demo/README.rst b/src/three-minute-demo/README.rst new file mode 100644 index 0000000..1247ea1 --- /dev/null +++ b/src/three-minute-demo/README.rst | |||
@@ -0,0 +1,80 @@ | |||
1 | 3 Minute Demo of OpenStack Public Clouds | ||
2 | ======================================== | ||
3 | |||
4 | This is all the Ansible needed for the 3 minute public cloud demo. | ||
5 | |||
6 | It uses docker containers to avoid the need to install things on the local | ||
7 | computer. The Dockerfile uses the base ``python`` docker image regardless | ||
8 | of other distro since it's just a container for installing ansible. | ||
9 | |||
10 | .. note:: | ||
11 | |||
12 | There is nothing docker-specific about the demo, it's just being used as | ||
13 | a convenient way to bundle actions without polluting the user's computer. | ||
14 | The playbooks themselves can be used directly for people who have the | ||
15 | pre-reqs of ansible, shade and diskimage-builder installed or who do not | ||
16 | mind installing them globally. | ||
17 | |||
18 | Building Docker Image | ||
19 | --------------------- | ||
20 | |||
21 | Step one is building the docker image: | ||
22 | |||
23 | .. code-block:: bash | ||
24 | |||
25 | docker build -t three-minute-demo . | ||
26 | |||
27 | A convenience script, ``build-docker-image.sh`` is provided that runs that | ||
28 | command. | ||
29 | |||
30 | Wrapper Script | ||
31 | -------------- | ||
32 | |||
33 | Once the ``three-minute-demo`` image exists, the ``ansible-playbook.sh`` script | ||
34 | will user it to run ``ansible-playbook``. By default it will run the | ||
35 | ``run.yaml`` playbook, but that can be overridden by passing parameters to the | ||
36 | script. | ||
37 | |||
38 | The ``ansible-playbook.sh`` script will also bind-mount the current directory | ||
39 | as the main work dir and ``~/.config/openstack`` into ``/etc/openstack`` in the | ||
40 | container so that ``clouds.yaml`` is available. | ||
41 | |||
42 | .. note:: | ||
43 | |||
44 | If ~/.config/openstack doesn't exist but /etc/openstack does, | ||
45 | ansible-playbook.sh will mount /etc/openstack instead. If a different setup | ||
46 | is desired, you can always run docker commands. | ||
47 | |||
48 | Building and Uploading Images | ||
49 | ----------------------------- | ||
50 | |||
51 | The demo depends on base images existing. The ``prep.yaml`` playbook will | ||
52 | create the images and upload them to all of the cloud regions. | ||
53 | |||
54 | .. code-block:: bash | ||
55 | |||
56 | ./ansible-playbook.sh prep.yaml | ||
57 | |||
58 | By default it will create a minimal ubuntu image. That can be changed by | ||
59 | setting ``distro`` on the ansible-playbook command line to something else, such | ||
60 | as ``fedora`` or ``centos``. | ||
61 | |||
62 | .. code-block:: bash | ||
63 | |||
64 | ./ansible-playbook.sh -edistro=fedora prep.yaml | ||
65 | |||
66 | The Demo | ||
67 | -------- | ||
68 | |||
69 | ``ansible-playbook.sh`` defaults to running ``demo.yaml``, which will create a | ||
70 | server in each cloud region, install Apache on that server, write out a json | ||
71 | file for apache to serve, fetch the contents into a variable and print out the | ||
72 | FQDN. | ||
73 | |||
74 | If you're thinking "wow, that's not useful" - you're right! This isn't intended | ||
75 | to be a demo of doing useful things with Ansible. It's intended to be a demo of | ||
76 | getting servers on a set of cloud regions across multiple public clouds and | ||
77 | then doing something with them. | ||
78 | |||
79 | Once you can perform a single task on the remote server with Ansible, you can | ||
80 | do anything with Ansible you want to do. | ||