1
0
mirror of https://github.com/jcwimer/startup-infrastructure synced 2026-03-24 22:34:42 +00:00

Created shell, ansible-dependencies, common, and gitea roles

This commit is contained in:
2018-07-27 00:59:24 +00:00
parent 090805b618
commit 2490fba2a2
15 changed files with 320 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
---
- name: Install package dependencies
raw: apt-get update -qq && apt-get install -y python-dev python-simplejson python-urllib3 python-openssl python-pyasn1 python-pip ca-certificates
- name: Install pip dependencies
raw: pip install ndg-httpsclient
ignore_errors: true
- name: Install pip dependencies again because it fails sometimes
raw: pip install ndg-httpsclient
ignore_errors: true

22
tasks/swarm-bootstrap.yml Normal file
View File

@@ -0,0 +1,22 @@
---
- name: Initialize swarm on the bootstrap manager
command: >
docker swarm init --advertise-addr "{{ ansible_eth1.ipv4.address }}"
register: docker_swarm_init
changed_when: docker_swarm_init.rc == 0
ignore_errors: true
- name: Set manager key variable
command: docker swarm join-token -q manager
register: manager_key
changed_when: manager_key.rc == 0
- name: Set worker key variable
command: docker swarm join-token -q worker
register: worker_key
changed_when: worker_key.rc == 0
- name: Set work and manager key facts
set_fact:
manager_key: "{{ manager_key }}"
worker_key: "{{ worker_key }}"

48
tasks/ubuntu-common.yml Normal file
View File

@@ -0,0 +1,48 @@
---
- name: Add docker key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add docker repo
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
state: present
- name: Update apt
apt: update_cache=yes
- name: Install standard programs
apt: name={{ item }} state=present force=yes
with_items:
- htop
- curl
- openssh-server
- git
- rsync
- zip
- unzip
- fail2ban
- ntp
- mysql-client
- wget
- nfs-common
- docker-ce={{docker_ce_version_to_install}}
- sshpass
- ack-grep
- dnsutils
- nmon
- build-essential
- tmux
- name: Docker compose version
get_url:
url: "https://github.com/docker/compose/releases/download/{{docker_compose_version_to_install}}/docker-compose-{{ ansible_system }}-{{ ansible_userspace_architecture }}"
dest: /usr/local/bin/docker-compose
validate_certs: false
mode: 0755
- name: Set timezone to NewYork
timezone:
name: America/New_York
ignore_errors: true