mirror of
https://github.com/jcwimer/startup-infrastructure
synced 2026-05-13 00:37:02 +00:00
Switched from docker swarm to Kubernetes with rke
This commit is contained in:
2
roles/common/defaults/main.yml
Normal file
2
roles/common/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
docker_ce_version_to_install: 19.03.8
|
||||
@@ -7,6 +7,7 @@
|
||||
# apt: upgrade=dist
|
||||
- name: Update apt
|
||||
apt: update_cache=yes
|
||||
become: true
|
||||
|
||||
- name: Install standard programs
|
||||
apt: name={{ item }} state=present force=yes
|
||||
@@ -31,37 +32,50 @@
|
||||
- build-essential
|
||||
- tmux
|
||||
- sudo
|
||||
become: true
|
||||
|
||||
|
||||
- name: Install required packages for Longhorn
|
||||
apt: name={{ item }} state=present force=yes
|
||||
with_items:
|
||||
- open-iscsi
|
||||
- curl
|
||||
become: true
|
||||
when: longhorn_enabled is defined and longhorn_enabled | bool == True
|
||||
|
||||
- name: Add docker key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Add docker repo
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Update apt
|
||||
apt: update_cache=yes
|
||||
become: true
|
||||
|
||||
- name: Install docker-ce
|
||||
shell: >
|
||||
apt-get install -y -qq docker-ce=$(apt-cache madison docker-ce | grep "{{ docker_ce_version_to_install }}" | awk {'print $3'})
|
||||
become: true
|
||||
|
||||
- name: Add standard_user to docker group
|
||||
user:
|
||||
name: "{{ standard_user }}"
|
||||
groups: docker
|
||||
append: yes
|
||||
become: true
|
||||
|
||||
- name: Set timezone to NewYork
|
||||
timezone:
|
||||
name: "{{ chosen_timezone }}"
|
||||
ignore_errors: true
|
||||
|
||||
- name: Replace sudoers file
|
||||
template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers
|
||||
become: true
|
||||
|
||||
- name: Create /etc/docker
|
||||
file:
|
||||
@@ -70,16 +84,16 @@
|
||||
owner: root
|
||||
mode: 700
|
||||
state: directory
|
||||
become: true
|
||||
|
||||
- name: Replace docker daemon file
|
||||
template: src=../roles/common/templates/docker-daemon.json.j2 dest=/etc/docker/daemon.json
|
||||
register: dockerdaemon
|
||||
become: true
|
||||
|
||||
- name: Restart docker if daemon changes
|
||||
service:
|
||||
name: docker
|
||||
state: restarted
|
||||
when: dockerdaemon.changed
|
||||
|
||||
- name: Creates directory
|
||||
file: path=/data state=directory
|
||||
become: true
|
||||
@@ -1,30 +0,0 @@
|
||||
#
|
||||
# This file MUST be edited with the 'visudo' command as root.
|
||||
#
|
||||
# Please consider adding local content in /etc/sudoers.d/ instead of
|
||||
# directly modifying this file.
|
||||
#
|
||||
# See the man page for details on how to write a sudoers file.
|
||||
#
|
||||
Defaults env_reset
|
||||
Defaults mail_badpass
|
||||
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
# Host alias specification
|
||||
|
||||
# User alias specification
|
||||
|
||||
# Cmnd alias specification
|
||||
|
||||
# User privilege specification
|
||||
root ALL=(ALL:ALL) ALL
|
||||
|
||||
# Members of the admin group may gain root privileges
|
||||
%admin ALL=(ALL) ALL
|
||||
|
||||
# Allow members of group sudo to execute any command
|
||||
%sudo ALL=(ALL) NOPASSWD:ALL
|
||||
# See sudoers(5) for more information on "#include" directives:
|
||||
|
||||
#includedir /etc/sudoers.d
|
||||
|
||||
Reference in New Issue
Block a user