Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevgathuku/ansible-ubuntu
Automate initial server setup with Ansible
https://github.com/kevgathuku/ansible-ubuntu
Last synced: about 1 month ago
JSON representation
Automate initial server setup with Ansible
- Host: GitHub
- URL: https://github.com/kevgathuku/ansible-ubuntu
- Owner: kevgathuku
- License: mit
- Created: 2015-04-18T14:17:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T06:37:43.000Z (over 1 year ago)
- Last Synced: 2024-04-16T04:06:54.612Z (8 months ago)
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-ubuntu
Automate inital server setup using Ansible.# How it Works
The general idea is that given a newly-created server and you would like to automate its initial setup, you would just run this script, instead of running most of the setup commands manually.# Current Functionality
Currently, this is able to automate the following:
- Upgrading the distro
- Creates a regular user
- Install a few useful packages# Setup
First, Ansible needs to be installed locally, preferrably in a virtualenv. Let's do that- Create a new virtual environment.
`mkvirtualenv ansible`
- Activate the virtualenv
`workon ansible`
- Install the requirements
`pip install -r requirements.txt`# Usage Instructions
- Clone this repo
`git clone [email protected]:kevgathuku/ansible-ubuntu.git`
- Change directory into the newly-created folder
`cd ansible-ubuntu`
- Copy the `hosts.example` file to `hosts`
`cp hosts.example hosts`
- Open the `hosts` file and replace `127.0.0.1` with your actual server address(es)
You can fill in one or more server addresses here, each in a new line.For example, a sample `hosts` file would look like this
```
[main]
127.0.0.1
127.0.0.2
```When you've done this, let's finally get this running
```shell
ansible-playbook -i hosts playbook.yml
```If using `pipenv` run:
```shell
pipenv run ansible-playbook -i hosts playbook.yml
```