diff --git a/hosts b/hosts new file mode 100644 index 0000000..3c591f1 --- /dev/null +++ b/hosts @@ -0,0 +1,24 @@ +########################## +# DO Community Playbooks +# Example Inventory +########################## + +######################################################################### +# The "servers" groups is an example of a group with three servers, +# each identified by a custom alias. +######################################################################### + +[servers] +server1 ansible_host=174.138.13.97 +server2 ansible_host=188.166.115.68 +server3 ansible_host=188.166.123.245 + +########################################################################## +# Makes sure we use Python 3 (/usr/bin/python3) on remote hosts. +# [servers:vars] sets global values for all nodes in the "servers" group. +# This is necessary because by default Ansible will try to use +# /usr/bin/python, which is not available on newer Ubuntu versions. +######################################################################### +[servers:vars] +ansible_python_interpreter=/usr/bin/python3 + diff --git a/mariadb/playbook.yml b/mariadb/playbook.yml deleted file mode 100755 index 5a9fc8c..0000000 --- a/mariadb/playbook.yml +++ /dev/null @@ -1,29 +0,0 @@ -################################################# -# DO Community Playbooks: Docker -################################################# ---- -- hosts: all - become: true - vars_files: - - vars/default.yml - - tasks: - - name: Pull default Mariadb image - docker_image: - name: "{{ image_name }}" - source: pull - state: present - - # Creates the number of containers defined by the variable create_containers, using values from vars file - - name: Create Mariadb container - docker_container: - name: "{{ container_name }}" - image: "{{ image_name }}" - state: started - restart_policy: "unless-stopped" - env: - MARIADB_ROOT_PASSWORD: "{{ db_password }}" - published_ports: - - 3306:3306 - volumes: - - "{{ data_location }}:/var/lib/mysql" diff --git a/mariadb/readme.md b/mariadb/readme.md deleted file mode 100644 index f6d7ecc..0000000 --- a/mariadb/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# Docker on Ubuntu 18.04 - -This playbook will install Docker an Ubuntu 18.04 machine, as explained in the guide on -[How to Use Ansible to Install and Set Up Docker on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-docker-on-ubuntu-18-04). -A number of containers will be created with the options specified in the `vars/default.yml` variable file. - -## Settings - -- `create_containers`: number of containers to create. -- `default_container_name`: default name for new containers. -- `default_container_image`: default image for new containers. -- `default_container_command`: default command to run on new containers. - - -## Running this Playbook - -Quick Steps: - -### 1. Obtain the playbook -```shell -git clone https://github.com/do-community/ansible-playbooks.git -cd ansible-playbooks/docker_ubuntu1804 -``` - -### 2. Customize Options - -```shell -nano vars/default.yml -``` - -```yml -#vars/default.yml ---- -create_containers: 4 -default_container_name: docker -default_container_image: ubuntu -default_container_command: sleep 1d -``` - -### 3. Run the Playbook - -```command -ansible-playbook -l [target] -i [inventory file] -u [remote user] playbook.yml -``` - -For more information on how to run this Ansible setup, please check this guide: [How to Use Ansible to Install and Set Up Docker on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-docker-on-ubuntu-18-04). \ No newline at end of file diff --git a/mariadb/vars/default.yml b/mariadb/vars/default.yml deleted file mode 100644 index 90cdc16..0000000 --- a/mariadb/vars/default.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -container_name: mariadb -image_name: mariadb:latest -db_password: '123456' -data_location: /var/lib/mariadb/data -