Let's jump right into examining the roles we created.
The completed role and file named main.yml
located in the install-docker/tasks
directory looks similar to this:
--- - name: Install additional packages apt: name={{item}} state=present with_items: - git - wget - name: Pull down and install Docker packages shell: chdir=/opt wget -qO- https://get.docker.com/ | sh - name: Verify the Docker install command: docker run hello-world - name: Add Nova user to Docker group command: usermod -aGdocker nova
The completed role and file named main.yml
located in the nova-docker/tasks
directory looks as follows:
--- - name: Pull down nova-docker package command: chdir=/opt git clone http://github.com/stackforge/nova-docker.git - name: Check out nova-docker branch pre-i18n command: chdir=/opt/nova-dockergit checkout -b pre-i18n d1ad84793b7f2182de04df8a5323d6928af672ca - name: Install nova-docker package command: chdir=/opt/nova-docker pip install