Skip to content

Commit

Permalink
sbt installation, dry violations, ansible.cfg (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmangold authored Oct 14, 2020
1 parent ab8f46e commit fa275dc
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.terraform
*.tfstate
tests/inventory
5 changes: 5 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[defaults]
callback_whitelist = profile_tasks

[ssh_connection]
pipelining = True
14 changes: 6 additions & 8 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---

apt_packages:
- awscli
- bash
- build-essential
- ca-certificates
- curl
- default-jre
- git
- openssl
- python3
- ssh
- ssh-client
Expand All @@ -14,17 +19,13 @@ apt_packages:
docker_packages:
- apt-transport-https
- aptitude
- ca-certificates
- curl
- software-properties-common
- python3-pip
- virtualenv
- python3-setuptools

postgres_packages:
- acl
- bash
- openssl
- libpq-dev
- libssl-dev
- libssl-doc
Expand All @@ -34,11 +35,8 @@ postgres_packages:

user: ubuntu

db_user: ubuntu
db_name: ubuntu
db_password: ubuntu

docker_user: ubuntu

git_username: git-user
git_email: [email protected]
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- import_tasks: ../tasks/packages.yml
- import_tasks: ../tasks/tools/git.yml
- import_tasks: ../tasks/tools/docker.yml
- import_tasks: ../tasks/tools/sbt.yml
- import_tasks: ../tasks/tools/postgres.yml
- import_tasks: ../tasks/tools/oh-my-zsh.yml
- import_tasks: ../tasks/tools/nodejs.yml
Expand Down
4 changes: 2 additions & 2 deletions tasks/tools/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
pip:
name: docker

- name: Add docker_user user to docker group
- name: Add user to docker group
user:
name: "{{ docker_user }}"
name: "{{ user }}"
group: docker

- name: Ensure the Docker service is running
Expand Down
4 changes: 2 additions & 2 deletions tasks/tools/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
service: name=postgresql state=started enabled=yes

- name: Create postgres user
postgresql_user: name={{ db_user }} password={{ db_password }}
postgresql_user: name={{ user }} password={{ db_password }}
become_user: postgres

- name: Create postgres database
Expand All @@ -15,7 +15,7 @@
- name: Connect to ubuntu database, create ubuntu user, and grant access
become_user: postgres
postgresql_user:
db: "{{ db_user }}"
db: "{{ user }}"
name: "{{ db_name }}"
password: "{{ db_password }}"
encrypted: yes
Expand Down
9 changes: 9 additions & 0 deletions tasks/tools/sbt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Add sbt repo
apt_repository: repo='deb https://dl.bintray.com/sbt/debian /' state=present update_cache=no

- name: Add sbt repo key
apt_key: keyserver='hkp://keyserver.ubuntu.com:80' id='2EE0EA64E40A89B84B2DF73499E82A75642AC823'

- name: Install sbt
apt: name=sbt state=present update_cache=yes
1 change: 0 additions & 1 deletion tests/inventory

This file was deleted.

0 comments on commit fa275dc

Please sign in to comment.