Skip to content

Commit

Permalink
ADD: debian support. (#14)
Browse files Browse the repository at this point in the history
UPDATE: to support debian and ubuntu.
  • Loading branch information
andreaspeters authored May 10, 2022
1 parent 3d06e20 commit 7707a5c
Show file tree
Hide file tree
Showing 24 changed files with 306 additions and 529 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This playbook deploys a full Apache Mesos stack. The access to mesos (agent and

## Requirements

- CentOS 7
- CentOS 7 or Debian/Ubuntu
- Ansible Galaxy collection: community.general


Expand Down Expand Up @@ -73,20 +73,20 @@ ansible-playbook -i ../inventory/inventory/mesos plays/server-config.yaml --tags

| Software version | Role | Install type |
| ------------------ | :-------------------------------: | :--------------------------------: |
| Mesos 1.11.0 | Mesos Masters | RPM |
| Marathon 1.11.30 | Marathon masters | RPM |
| Zookeeper 3.7.0 | Zookeeper cluster | dependencies to Mesos/Marathon RPM |
| Mesos-DNS 0.8.1 | Service Discovery for Mesos Tasks | RPM |
| Mesos 1.11.0 | Mesos Masters | RPM/DEB |
| Marathon 1.11.30 | Marathon masters | RPM/DEB |
| Zookeeper 3.8.0 | Zookeeper cluster | RPM/DEB |
| Mesos-DNS 0.8.2 | Service Discovery for Mesos Tasks | RPM/DEB |

## Worker node

| Software version | Role | Install type |
| ------------------ | :-------------------------------: | :----------: |
| Mesos 1.11.0 | Mesos Agent | RPM |
| Docker latest | Docker engine | RPM |
| Mesos 1.11.0 | Mesos Agent | RPM/DEB |
| Docker latest | Docker engine | RPM/DEB |
| Weave 2.8.1 | Container networking | Docker image |
| Weavescope 1.11.3 | Container Management | Docker image |
| DNSMasq 2 | Container DNS | RPM |
| DNSMasq 2 | Container DNS | RPM/DEB |

## Persistent Storage

Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# master
- Add support for Debian based systems.
- CentOS7 is deprecated and would be removed in the future
- Update Mesos DNS to v0.8.2

# v0.19.0

- Add the possibility to install a docker engine at the manager server
Expand Down
10 changes: 10 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs ? import <nixpkgs> { } }:

with pkgs;

mkShell {
buildInputs = [
ansible
];
}

434 changes: 0 additions & 434 deletions history.md

This file was deleted.

14 changes: 0 additions & 14 deletions plays/roles/centos/tasks/main.yml

This file was deleted.

28 changes: 19 additions & 9 deletions plays/roles/dnsmasq/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
---

- name: install dnsmasq packages
yum:
- name: "get facts of installed packages"
package_facts:
manager: "auto"

- name: install dnsmasq packages centos
package:
name:
- dnsmasq
- bind-utils
state: latest
state: present
when:
ansible_os_family == "RedHat"

- name: Check if NetworkManager is installed
command: rpm -q NetworkManager
register: rpm_check
ignore_errors: true
- name: install dnsmasq packages ubuntu
package:
name:
- dnsmasq
- dnsutils
state: present
when:
ansible_os_family == "Debian"

- name: disable update resolv conf of network manager
copy: src=NetworkManager.conf dest=/etc/NetworkManager/NetworkManager.conf mode=0644
when: rpm_check.stdout.find('is not installed') == -1
when: "'NetworkManager' is in ansible_facts.packages"

- name: disable update resolv conf of dhclient
copy: src=dhclient-enter-hooks dest=/etc/dhclient-enter-hooks mode=0755
Expand All @@ -24,7 +34,7 @@
name: NetworkManager
state: restarted
enabled: yes
when: rpm_check.stdout.find('is not installed') == -1
when: "'NetworkManager' is in ansible_facts.packages"

- name: collect nameservers
shell: "cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2"
Expand Down
2 changes: 2 additions & 0 deletions plays/roles/docker/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ docker_registry:

docker_options: ""
containerd_package: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

docker: false
26 changes: 24 additions & 2 deletions plays/roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,51 @@

- name: add docker repo
copy: src=docker-ce.repo dest=/etc/yum.repos.d/docker-main.repo mode=0644
when:
ansible_os_family == "RedHat"

- name: enable docker update
lineinfile:
dest: "/etc/yum.conf"
regexp: "^exclude=mesos*"
line: '#exclude=mesos* docker* ceph*'
state: present
when:
ansible_os_family == "RedHat"

- name: add docker gpg-key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
when:
ansible_os_family == "Debian"

- name: add docker apt repository
apt_repository:
repo: "deb https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_lsb.codename|lower }} stable"
state: present
filename: docker
update_cache: yes
when:
ansible_os_family == "Debian"

- name: install docker packages
yum:
package:
name:
- e2fsprogs
- xfsprogs
- docker-ce
- containerd.io
state: installed
state: present

- name: disable docker update
lineinfile:
dest: "/etc/yum.conf"
regexp: "^#exclude=mesos*"
line: 'exclude=mesos* docker* ceph*'
state: present
when:
ansible_os_family == "RedHat"

- name: configure docker dns
lineinfile:
Expand Down
2 changes: 2 additions & 0 deletions plays/roles/marathon/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@

- name: set ssl keystore file
lineinfile: dest=/etc/sysconfig/marathon create=yes state=present regexp="^MARATHON_SSL_KEYSTORE_PATH=*" line="MARATHON_SSL_KEYSTORE_PATH=/etc/mesos/ssl/marathon.jks"
when: libprocess_enable_ssl|bool == True

- name: set ssl keystore password
lineinfile: dest=/etc/sysconfig/marathon create=yes state=present regexp="^MARATHON_SSL_KEYSTORE_PASSWORD=*" line="MARATHON_SSL_KEYSTORE_PASSWORD={{ marathon_jks_password }}"
when: libprocess_enable_ssl|bool == True

- name: Change group owner of secret file
file:
Expand Down
6 changes: 4 additions & 2 deletions plays/roles/mesos-agent/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ libprocess_ssl_enable_downgrade: "true"
libprocess_ssl_ciphers: "AES128-SHA:AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA"

mesos_rpm: "mesos-1.11.0"
mesos_deb: "mesos=1.11.1-1.ubuntu2004"


mesos_ssl_key: "../files/mesos.key"
mesos_ssl_crt: "../files/mesos.crt"

mesos_ip_address: "{{ ansible_default_ipv4.address }}"

mesos_logs_dir: "/var/log/mesos"
mesos_ulimit: "16384"

mesos_etc_dir: "/etc/mesos-agent"

libprocess_ssl_hostname_validation_scheme: "openssl"


Loading

0 comments on commit 7707a5c

Please sign in to comment.