Compare commits
1 commit
6708653c94
...
4f7eab9d8d
Author | SHA1 | Date | |
---|---|---|---|
Víðir Valberg Guðmundsson | 4f7eab9d8d |
47
Vagrantfile
vendored
47
Vagrantfile
vendored
|
@ -1,35 +1,24 @@
|
||||||
Vagrant.require_version ">= 2.0.0"
|
Vagrant.require_version ">= 1.7.0"
|
||||||
PORT = 19022
|
|
||||||
|
|
||||||
def provisioned?(vm="default", provider="virtualbox")
|
|
||||||
File.exist?(".vagrant/machines/#{vm}/#{provider}/action_provision")
|
|
||||||
end
|
|
||||||
|
|
||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
config.vm.network :private_network, ip: "192.168.56.10"
|
|
||||||
config.vm.network :forwarded_port, guest: PORT, host: PORT
|
|
||||||
|
|
||||||
config.vm.box = "ubuntu/focal64"
|
config.vm.define "datacoop" do |datacoop|
|
||||||
config.vm.hostname = "datacoop"
|
datacoop.vm.box = "ubuntu/bionic64"
|
||||||
|
datacoop.vm.hostname = "datacoop"
|
||||||
config.vm.provider :virtualbox do |v|
|
datacoop.vm.provider "virtualbox" do |v|
|
||||||
v.memory = 4096
|
v.memory = 4096
|
||||||
end
|
end
|
||||||
|
datacoop.vm.network "private_network", ip: "192.168.0.42"
|
||||||
config.vm.provision :ansible do |ansible|
|
datacoop.vm.provision "ansible" do |ansible|
|
||||||
ansible.compatibility_mode = "2.0"
|
ansible.verbose = "v"
|
||||||
ansible.playbook = "playbook.yml"
|
ansible.compatibility_mode = "2.0"
|
||||||
ansible.ask_vault_pass = true
|
ansible.playbook = "playbook.yml"
|
||||||
ansible.verbose = "v"
|
ansible.ask_vault_pass = true
|
||||||
ansible.extra_vars = {
|
ansible.host_vars = {
|
||||||
base_domain: "datacoop.devel"
|
"datacoop" => {"ansible_python_interpreter" => "/usr/bin/python3.6"}
|
||||||
}
|
}
|
||||||
|
ansible.groups = {
|
||||||
# If the VM is already provisioned, we need to use the new port
|
"all" => ["datacoop"]
|
||||||
if provisioned?
|
|
||||||
config.ssh.guest_port = PORT
|
|
||||||
ansible.extra_vars = {
|
|
||||||
ansible_port: PORT
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
gather_facts: true
|
gather_facts: False
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
base_domain: data.coop
|
base_domain: data.coop
|
||||||
letsencrypt_email: admin@data.coop
|
letsencrypt_email: admin@data.coop
|
||||||
ldap_dn: "dc=data,dc=coop"
|
ldap_dn: "dc=data,dc=coop"
|
||||||
|
|
||||||
vagrant: "{{ ansible_virtualization_role == 'guest' }}"
|
|
||||||
letsencrypt_enabled: "{{ not vagrant }}"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- nginx-proxy
|
- nginx-proxy
|
||||||
- postfix
|
|
||||||
- openldap
|
- openldap
|
||||||
- nextcloud
|
- nextcloud
|
||||||
- passit
|
- passit
|
||||||
- gitea
|
- gitea
|
||||||
|
- postfix
|
||||||
- matrix_riot
|
- matrix_riot
|
||||||
- privatebin
|
- privatebin
|
||||||
- codimd
|
- codimd
|
||||||
|
@ -39,6 +36,6 @@
|
||||||
- import_role:
|
- import_role:
|
||||||
name: ubuntu_base
|
name: ubuntu_base
|
||||||
tags:
|
tags:
|
||||||
- base_only
|
- base_only
|
||||||
- import_role:
|
- import_role:
|
||||||
name: docker
|
name: docker
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
args:
|
args:
|
||||||
creates: "{{ services.docker_registry.volume_folder }}/auth/htpasswd"
|
creates: "{{ services.docker_registry.volume_folder }}/auth/htpasswd"
|
||||||
|
|
||||||
- name: log in to registry
|
- name: log in to local registry
|
||||||
docker_login:
|
docker_login:
|
||||||
registry: "{{ services.docker_registry.domain }}"
|
registry: "{{ services.docker_registry.domain }}"
|
||||||
username: "docker"
|
username: "docker"
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
dest: "{{ services.mailu.volume_folder }}/certs/cert.pem"
|
dest: "{{ services.mailu.volume_folder }}/certs/cert.pem"
|
||||||
state: hard
|
state: hard
|
||||||
force: yes
|
force: yes
|
||||||
when: letsencrypt_enabled
|
|
||||||
|
|
||||||
- name: hard link to Let's Encrypt TLS key
|
- name: hard link to Let's Encrypt TLS key
|
||||||
file:
|
file:
|
||||||
|
@ -36,7 +36,6 @@
|
||||||
dest: "{{ services.mailu.volume_folder }}/certs/key.pem"
|
dest: "{{ services.mailu.volume_folder }}/certs/key.pem"
|
||||||
state: hard
|
state: hard
|
||||||
force: yes
|
force: yes
|
||||||
when: letsencrypt_enabled
|
|
||||||
|
|
||||||
- name: run mail server containers
|
- name: run mail server containers
|
||||||
docker_compose:
|
docker_compose:
|
||||||
|
|
|
@ -44,5 +44,4 @@
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
env:
|
env:
|
||||||
NGINX_PROXY_CONTAINER: nginx-proxy
|
NGINX_PROXY_CONTAINER: nginx-proxy
|
||||||
when: letsencrypt_enabled
|
|
||||||
|
|
||||||
|
|
|
@ -4,16 +4,13 @@
|
||||||
name: "{{ packages }}"
|
name: "{{ packages }}"
|
||||||
vars:
|
vars:
|
||||||
packages:
|
packages:
|
||||||
- aptitude
|
- aptitude
|
||||||
- python3-pip
|
- python3-pip
|
||||||
- apparmor
|
- apparmor
|
||||||
- haveged
|
- haveged
|
||||||
- mosh
|
- mosh
|
||||||
|
- ufw
|
||||||
- name: Install Dell OpenManage
|
- srvadmin-all # Dell OpenManage
|
||||||
apt:
|
|
||||||
name: srvadmin-all
|
|
||||||
when: not vagrant
|
|
||||||
|
|
||||||
- name: Install necessary packages via pip
|
- name: Install necessary packages via pip
|
||||||
pip:
|
pip:
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
---
|
---
|
||||||
- name: Import dell apt signing key
|
- name: import dell apt signing key
|
||||||
apt_key:
|
apt_key:
|
||||||
id: "1285491434D8786F"
|
id: "1285491434D8786F"
|
||||||
keyserver: "keyserver.ubuntu.com"
|
keyserver: "keyserver.ubuntu.com"
|
||||||
|
|
||||||
- name: Configure dell apt repo
|
- name: "configure dell apt repo"
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "deb https://linux.dell.com/repo/community/openmanage/10101/focal focal main"
|
repo: "deb https://linux.dell.com/repo/community/openmanage/10101/focal focal main"
|
||||||
state: present
|
state: "present"
|
||||||
|
|
||||||
- name: Restrict dell apt repo"
|
- name: "restrict dell apt repo"
|
||||||
copy:
|
copy:
|
||||||
dest: "/etc/apt/preferences.d/dell"
|
dest: "/etc/apt/preferences.d/dell"
|
||||||
content: |
|
content: |
|
||||||
|
@ -17,3 +17,7 @@
|
||||||
Package: *
|
Package: *
|
||||||
Pin: origin "linux.dell.com"
|
Pin: origin "linux.dell.com"
|
||||||
Pin-Priority: 400
|
Pin-Priority: 400
|
||||||
|
|
||||||
|
- name: update apt cache
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
|
@ -1,19 +1,12 @@
|
||||||
---
|
---
|
||||||
- import_tasks: ssh-port.yml
|
- import_tasks: custom-apt-repos.yml
|
||||||
tags: [change-ssh-port]
|
tags: [setup-custom-apt]
|
||||||
|
|
||||||
- import_tasks: dell-apt-repo.yml
|
|
||||||
tags: [setup-dell-apt-repo]
|
|
||||||
when: not vagrant
|
|
||||||
|
|
||||||
- import_tasks: upgrade.yml
|
- import_tasks: upgrade.yml
|
||||||
tags: [do-full-system-upgrade]
|
tags: [do-full-system-upgrade]
|
||||||
|
|
||||||
- import_tasks: base.yml
|
- import_tasks: base.yml
|
||||||
tags: [install-base-packages]
|
tags: [install-base-packages]
|
||||||
|
|
||||||
- import_tasks: users.yml
|
- import_tasks: users.yml
|
||||||
tags: [setup-users]
|
tags: [setup-users]
|
||||||
|
|
||||||
- import_tasks: firewall.yml
|
- import_tasks: firewall.yml
|
||||||
tags: [setup-firewall]
|
tags: [setup-firewall]
|
||||||
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
---
|
|
||||||
- name: Change SSH port on host
|
|
||||||
lineinfile:
|
|
||||||
dest: "/etc/ssh/sshd_config"
|
|
||||||
regexp: "^#?Port "
|
|
||||||
line: "Port 19022"
|
|
||||||
register: ssh_changed
|
|
||||||
|
|
||||||
- name: Restart sshd
|
|
||||||
service:
|
|
||||||
name: sshd
|
|
||||||
state: restarted
|
|
||||||
when: ssh_changed is defined and
|
|
||||||
ssh_changed.changed
|
|
||||||
|
|
||||||
- name: Change Ansible port to 19022
|
|
||||||
set_fact:
|
|
||||||
ansible_port: 19022
|
|
||||||
when: ssh_changed is defined and
|
|
||||||
ssh_changed.changed
|
|
Loading…
Reference in a new issue