Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
erika
committed
Dec 6, 2019
1 parent
965aeda
commit b78786c
Showing
3 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Initial Server Setup on Ubuntu 18.04 | ||
|
||
This playbook will execute a initial server setup for Ubuntu 18.04 systems, as explained in the guide on | ||
[Initial Server Setup Guide for Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-automate-initial-server-setup-on-ubuntu-18-04). | ||
A number of containers will be created with the options specified in the `vars/default.yml` variable file. | ||
|
||
## Settings | ||
|
||
- `create_user`: the name of the remote sudo user to create. | ||
- `copy_local_key`: path to a local SSH public key that will be copied as authorized key for the new user. By default, it copies the key from the current system user running Ansible. | ||
- `sys_packages`: array with list of packages that should be installed. | ||
|
||
|
||
## Running this Playbook | ||
|
||
Quick Steps: | ||
|
||
### 1. Obtain the playbook | ||
```shell | ||
git clone https://github.com/do-community/ansible-playbooks.git | ||
cd ansible-playbooks/setup_ubuntu1804 | ||
``` | ||
|
||
### 2. Customize Options | ||
|
||
```shell | ||
nano vars/default.yml | ||
``` | ||
|
||
```yml | ||
#vars/default.yml | ||
--- | ||
create_user: sammy | ||
copy_local_key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" | ||
sys_packages: [ 'curl', 'vim', 'git', 'ufw'] | ||
``` | ||
|
||
### 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: [Initial Server Setup Guide for Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-automate-initial-server-setup-on-ubuntu-18-04). |