From 7707a5cb77983179ceef12f722c2bf5401b06198 Mon Sep 17 00:00:00 2001 From: Andreas Peters Date: Tue, 10 May 2022 16:09:48 +0200 Subject: [PATCH] ADD: debian support. (#14) UPDATE: to support debian and ubuntu. --- README.md | 16 +- changelog.md | 5 + default.nix | 10 + history.md | 434 ------------------ plays/roles/centos/tasks/main.yml | 14 - plays/roles/dnsmasq/tasks/main.yml | 28 +- plays/roles/docker/defaults/main.yaml | 2 + plays/roles/docker/tasks/main.yml | 26 +- plays/roles/marathon/tasks/main.yml | 2 + plays/roles/mesos-agent/defaults/main.yaml | 6 +- plays/roles/mesos-agent/tasks/main.yml | 115 +++-- plays/roles/mesos-dns/defaults/main.yaml | 2 +- plays/roles/mesos-dns/tasks/main.yml | 16 +- plays/roles/mesos-master/defaults/main.yaml | 3 +- plays/roles/mesos-master/tasks/main.yml | 40 +- plays/roles/os/tasks/main.yml | 42 ++ plays/roles/repos/tasks/main.yml | 21 + plays/roles/weave/defaults/main.yaml | 2 + plays/roles/weave/tasks/main.yml | 2 +- .../weave_plugin_mesos/defaults/main.yaml | 3 + plays/roles/weave_plugin_mesos/tasks/main.yml | 2 +- plays/roles/zookeeper/defaults/main.yaml | 1 + plays/roles/zookeeper/tasks/main.yml | 25 +- plays/server-config.yaml | 18 +- 24 files changed, 306 insertions(+), 529 deletions(-) create mode 100644 default.nix delete mode 100644 history.md delete mode 100644 plays/roles/centos/tasks/main.yml create mode 100644 plays/roles/os/tasks/main.yml create mode 100644 plays/roles/weave_plugin_mesos/defaults/main.yaml diff --git a/README.md b/README.md index 63cea02..237ea01 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/changelog.md b/changelog.md index 9ba01af..05f82d0 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..148d667 --- /dev/null +++ b/default.nix @@ -0,0 +1,10 @@ +{ pkgs ? import { } }: + +with pkgs; + +mkShell { + buildInputs = [ + ansible + ]; +} + diff --git a/history.md b/history.md deleted file mode 100644 index 4ec53b6..0000000 --- a/history.md +++ /dev/null @@ -1,434 +0,0 @@ -# Past Versions - - -## v0.16.0 - -### Manager node - - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.11.0 | Mesos Masters | RPM | -| Marathon 1.10.17 | Marathon masters | RPM | -| Zookeeper 3.5.8 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | RPM | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :----------: | -| Mesos 1.11.0 | Mesos Agent | RPM | -| Docker 19.03.1-ce | Docker engine | RPM | -| Weave 2.6.0 | Container networking | Docker image | -| Weavescope 1.11.3 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| Rexray 0.11.4 | Persistant Storage | RPM | - - -## v0.15.0 - -### Manager node - - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.10.0 | Mesos Masters | RPM | -| Marathon 1.10.17 | Marathon masters | RPM | -| Zookeeper 3.5.8 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | RPM | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | -| Nodeexporter 0.18.2| Metric Exporter | Binary - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :----------: | -| Mesos 1.10.0 | Mesos Agent | RPM | -| Docker 19.03.1-ce | Docker engine | RPM | -| Weave 2.6.0 | Container networking | Docker image | -| Weavescope 1.11.3 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| Rexray 0.11.4 | Persistant Storage | RPM | -| Nodeexporter 0.18.2| Metric Exporter | Binary - -## v0.14.0 - -### Manager node - - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.10.0 | Mesos Masters | RPM | -| Marathon 1.8.218 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | Binary | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | -| Nodeexporter 0.18.2| Metric Exporter | Binary - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :----------: | -| Mesos 1.10.0 | Mesos Agent | RPM | -| Docker 19.03.1-ce | Docker engine | RPM | -| Weave 2.6.0 | Container networking | Docker image | -| Weavescope 1.11.3 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor (deprecated) | Docker engine monitoring | Docker image | -| Rexray 0.11.4 | Persistant Storage | RPM | -| Nodeexporter 0.18.2| Metric Exporter | Binary - - -## v0.13.0 - -### Manager node - - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.9.0 | Mesos Masters | RPM | -| Marathon 1.8.218 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | Binary | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | -| Nodeexporter 0.18.2| Metric Exporter | Binary - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :----------: | -| Mesos 1.9.0 | Mesos Agent | RPM | -| Docker 19.03.1-ce | Docker engine | RPM | -| Weave 2.6.0 | Container networking | Docker image | -| Weavescope 1.11.3 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor (deprecated) | Docker engine monitoring | Docker image | -| Rexray 0.11.4 | Persistant Storage | RPM | -| Nodeexporter 0.18.2| Metric Exporter | Binary - - - -## v0.12.0 - -### Manager node - -This will change the way how to load the configuration of mesos libs. If you add your own config to the file ```/etc/mesos-slave/modules``` please migrate the content. - -This will enable SSL communication for the mesos agents and mesos server. The verification of the ssl certificate is disabled (default). If you want to disable SSL, please add ```libprocess_enable_ssl: "false"``` to your group_vars inventory configuration. More information to Mesos and SSL: http://mesos.apache.org/documentation/latest/ssl/ - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.8.1 | Mesos masters | RPM | -| Marathon 1.8.218 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 1.5.3 | Service Discovery for Container | Binary | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | Binary | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.8.1 | Mesos slave | RPM | -| Docker 19.03.1-ce | Docker engine | RPM | -| Weave 2.5.2 | Container networking | Docker image | -| Weavescope 1.11.3 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor (DEPRECATED read changelog.md) | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | -| Consul 1.5.3 | Consul Client | Binary | - -### Graylog DEPRECATED (read changelog.md) - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.5 | Log server | RPM | -| Elasticsearch 5.3.1 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus DEPRECATED (read changelog.md) - -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | - - -## v0.11.1 - -### Manager node - -This will change the way how to load the configuration of mesos libs. If you add your own config to the file ```/etc/mesos-slave/modules``` please migrate the content. - -This will enable SSL communication for the mesos agents and mesos server. The verification of the ssl certificate is disabled (default). If you want to disable SSL, please add ```libprocess_enable_ssl: "false"``` to your group_vars inventory configuration. More information to Mesos and SSL: http://mesos.apache.org/documentation/latest/ssl/ - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.8.0 | Mesos masters | RPM | -| Marathon 1.8.218 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 1.5.3 | Service Discovery for Container | Binary | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | Binary | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.8.0 | Mesos slave | RPM | -| Docker 18.06.1.ce | Docker engine | RPM | -| Weave 2.5.2 | Container networking | Docker image | -| Weavescope 1.11.3 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor (DEPRECATED read changelog.md) | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | -| Consul 1.5.3 | Consul Client | Binary | - -### Graylog DEPRECATED (read changelog.md) - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.5 | Log server | RPM | -| Elasticsearch 5.3.1 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus DEPRECATED (read changelog.md) - -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | - - -## v0.11.0 - -This will update weave! It can be, that the docker daemon will restart after the weave update. - -### Manager node - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.8.0 | Mesos masters | RPM | -| Marathon 1.8.218 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 1.5.3 | Service Discovery for Container | Binary | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | Binary | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.8.0 | Mesos slave | RPM | -| Docker 18.06.1.ce | Docker engine | RPM | -| Weave 2.5.2 | Container networking | Docker image | -| Weavescope 1.11.3 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | -| Consul 1.5.3 | Consul Client | Binary | - -### Graylog - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.5 | Log server | RPM | -| Elasticsearch 5.3.1 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus - -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | - - - -## v0.10.0 - -With this Version we will include Mesos-DNS for Service Discovery of Mesos tasks. Its not a replace of consul. Consul will resolve the weave ip address inside the container. Mesos-DNS will resolv the IP address of the host where the task is running. - -### Manager node - -| Software version | Role | Install type | -| ------------------ | :-------------------------------: | :--------------------------------: | -| Mesos 1.8.0 | Mesos masters | RPM | -| Marathon 1.8.218 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 1.3.0 | Service Discovery for Container | Binary | -| Mesos-DNS 0.7.0 | Service Discovery for Mesos Tasks | Binary | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.8.0 | Mesos slave | RPM | -| Docker 18.06.1.ce | Docker engine | RPM | -| Weave 2.1.3 | Container networking | Docker image | -| Weavescope 1.6.7 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | -| Consul 1.3.0 | Consul Client | Binary | - -### Graylog - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.5 | Log server | RPM | -| Elasticsearch 5.3.1 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | - -## v0.9.0 - -### Manager node - -| Software version | Role | Install type | -| ------------------ | :---------------: | :--------------------------------: | -| Mesos 1.8.0 | Mesos masters | RPM | -| Marathon 1.7.189 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 1.3.0 | Consul server | Binary | -| Metronome 0.6.30 | Schedule Server | JAVA dependencies to Marathon | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.8.0 | Mesos slave | RPM | -| Docker 18.06.1.ce | Docker engine | RPM | -| Weave 2.1.3 | Container networking | Docker image | -| Weavescope 1.6.7 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | -| Consul 1.3.0 | Consul Client | Binary | - -### Graylog - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.5 | Log server | RPM | -| Elasticsearch 5.3.1 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | - -## v0.8.0 - -### Manager node - -| Software version | Role | Install type | -| ------------------ | :---------------: | :--------------------------------: | -| Mesos 1.6.1 | Mesos masters | RPM | -| Marathon 1.7.50 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 1.3.0 | Consul server | Binary | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.6.1 | Mesos slave | RPM | -| Docker 18.06.1.ce | Docker engine | RPM | -| Weave 2.1.3 | Container networking | Docker image | -| Weavescope 1.6.7 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | -| Consul 1.3.0 | Consul Client | Binary | -| Chronos 2.5.1 | Chronos Server | RPM | - -### Graylog - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.4 | Log server | RPM | -| Elasticsearch 1.7.3 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus - -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | - -## v0.7.0 - -### Manager node - -| Software version | Role | Install type | -| ------------------ | :---------------: | :--------------------------------: | -| Mesos 1.6.1 | Mesos masters | RPM | -| Marathon 1.7.50 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 0.9.3 | Consul server | Binary | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.6.1 | Mesos slave | RPM | -| Docker 18.06.1.ce | Docker engine | RPM | -| Weave 2.1.3 | Container networking | Docker image | -| Weavescope 1.6.7 | Container Management | Docker image | -| DNSMasq 2 | Container DNS | RPM | -| CAdavisor | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | - -### Graylog - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.4 | Log server | RPM | -| Elasticsearch 1.7.3 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | - -## v0.6.0 - -### Manager node - -| Software version | Role | Install type | -| ------------------ | :---------------: | :--------------------------------: | -| Mesos 1.4.1 | Mesos masters | RPM | -| Marathon 1.5.4 | Marathon masters | RPM | -| Zookeeper 3.4.6 | Zookeeper cluster | dependencies to Mesos/Marathon RPM | -| Consul 0.9.3 | Consul server | Binary | - -### Worker node - -| Software version | Role | Install type | -| ------------------ | :------------------------: | :----------: | -| Mesos 1.4.1 | Mesos slave | RPM | -| Docker 17.12.0-ce | Docker engine | RPM | -| Weave 2.1.3 | Container networking | Docker image | -| Weavescope 1.6.7 | Container Management | Docker image | -| DNSMasq 2.76.2 | Container DNS | RPM | -| CAdavisor | Docker engine monitoring | Docker image | -| Registrator | Register Microservier name | Docker image | - -### Graylog - -| Software version | Role | Install type | -| ------------------- | :------------: | :----------: | -| Graylog 2.4 | Log server | RPM | -| Elasticsearch 1.7.3 | Search Engine | RPM | -| MongoDB | NoSQL Database | RPM | - -### Prometheus -| Software version | Role | Install type | -| ---------------- | :-----------------------------: | :----------: | -| Prometheus 1.7.1 | Timesserie database for metrics | Docker image | diff --git a/plays/roles/centos/tasks/main.yml b/plays/roles/centos/tasks/main.yml deleted file mode 100644 index 09bb654..0000000 --- a/plays/roles/centos/tasks/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- - -- name: deactivate selinux permanent - lineinfile: - dest: /etc/sysconfig/selinux - regexp: ^SELINUX= - line: SELINUX=disabled - state: present - create: yes - -- name: deactivate selinux temp - command: setenforce 0 - ignore_errors: true - diff --git a/plays/roles/dnsmasq/tasks/main.yml b/plays/roles/dnsmasq/tasks/main.yml index ce7ec84..65ed8e8 100644 --- a/plays/roles/dnsmasq/tasks/main.yml +++ b/plays/roles/dnsmasq/tasks/main.yml @@ -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 @@ -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" diff --git a/plays/roles/docker/defaults/main.yaml b/plays/roles/docker/defaults/main.yaml index dd5923d..b74976b 100644 --- a/plays/roles/docker/defaults/main.yaml +++ b/plays/roles/docker/defaults/main.yaml @@ -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 diff --git a/plays/roles/docker/tasks/main.yml b/plays/roles/docker/tasks/main.yml index 817c320..e2e35a8 100644 --- a/plays/roles/docker/tasks/main.yml +++ b/plays/roles/docker/tasks/main.yml @@ -2,6 +2,8 @@ - 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: @@ -9,15 +11,33 @@ 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: @@ -25,6 +45,8 @@ regexp: "^#exclude=mesos*" line: 'exclude=mesos* docker* ceph*' state: present + when: + ansible_os_family == "RedHat" - name: configure docker dns lineinfile: diff --git a/plays/roles/marathon/tasks/main.yml b/plays/roles/marathon/tasks/main.yml index 6ea957b..99df4b7 100644 --- a/plays/roles/marathon/tasks/main.yml +++ b/plays/roles/marathon/tasks/main.yml @@ -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: diff --git a/plays/roles/mesos-agent/defaults/main.yaml b/plays/roles/mesos-agent/defaults/main.yaml index 7551cc8..c26c7f2 100644 --- a/plays/roles/mesos-agent/defaults/main.yaml +++ b/plays/roles/mesos-agent/defaults/main.yaml @@ -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" diff --git a/plays/roles/mesos-agent/tasks/main.yml b/plays/roles/mesos-agent/tasks/main.yml index 3ea7b94..ac35fa8 100644 --- a/plays/roles/mesos-agent/tasks/main.yml +++ b/plays/roles/mesos-agent/tasks/main.yml @@ -6,14 +6,39 @@ regexp: "^exclude=mesos*" line: '#exclude=mesos* docker* ceph* zookeeper*' state: present + when: + ansible_os_family == "RedHat" -- name: install mesos agent packages - yum: +- name: install mesos agent packages centos + package: name: - apr-util - "{{ mesos_rpm }}" - containernetworking-plugins state: present + when: + ansible_os_family == "RedHat" + +- name: BUGFIX - install nss package to prevent dependencies problems with mesos-agent + package: + name: + - libcurl4-nss-dev + state: present + when: + ansible_os_family == "Debian" + +- name: install mesos agent packages ubuntu + package: + name: + - libsvn1 + - libsasl2-modules + - libevent-dev + - libcurl4-openssl-dev + - containernetworking-plugins + - "{{ mesos_deb }}" + state: present + when: + ansible_os_family == "Debian" - name: disable mesos update lineinfile: @@ -21,13 +46,15 @@ regexp: "^#exclude=mesos*" line: 'exclude=mesos* docker* ceph* zookeeper*' state: present + when: + ansible_os_family == "RedHat" - name: Remove deprecated config files file: path: "{{ item }}" state: absent with_items: - - "/etc/mesos-agent/modules" + - "{{ mesos_etc_dir }}/modules" - name: create zk file file: @@ -58,7 +85,7 @@ - cert - name: Check if old mesos-agent folder exist - stat: path=/etc/mesos-agent + stat: path={{ mesos_etc_dir }} register: mesos_agent - name: Remove deprecated config files @@ -66,8 +93,8 @@ path: "{{ item }}" state: absent with_items: - - "/etc/mesos-agent/seccomp_config_dir" - - "/etc/mesos-agent/seccomp_profile_name" + - "{{ mesos_etc_dir }}/seccomp_config_dir" + - "{{ mesos_etc_dir }}/seccomp_profile_name" - "/etc/default/mesos" - "/etc/default/mesos-agent" - "/etc/mesos/modules/logrotate.config" @@ -76,7 +103,7 @@ lineinfile: dest=/etc/mesos/zk create=yes state=present regexp="^zk=*" line="zk://client:{{ zookeeper_client_secret }}@{% for host in groups['manager'] %}{{ host }}:2181{% if not loop.last %},{% endif %}{% endfor %}/mesos" mode=0640 - name: configure master access - lineinfile: dest=/etc/mesos-agent/master create=yes state=present regexp="^zk=*" line="zk://client:{{ zookeeper_client_secret }}@{% for host in groups['manager'] %}{{ host }}:2181{% if not loop.last %},{% endif %}{% endfor %}/mesos" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/master create=yes state=present regexp="^zk=*" line="zk://client:{{ zookeeper_client_secret }}@{% for host in groups['manager'] %}{{ host }}:2181{% if not loop.last %},{% endif %}{% endfor %}/mesos" mode=0640 - name: configure user env string lineinfile: dest=/etc/default/mesos create=yes state=present regexp="^USER=*" line="USER=root" mode=0640 @@ -121,67 +148,89 @@ lineinfile: dest=/etc/sysconfig/marathon create=yes state=present regexp="^LIBPROCESS_SSL_ENABLE_DOWNGRADE=*" line="LIBPROCESS_SSL_ENABLE_DOWNGRADE={{ libprocess_ssl_enable_downgrade }}" mode=0640 - name: set hostname in mesos - lineinfile: dest=/etc/mesos-agent/hostname state=present regexp="^" line="{{ inventory_hostname }}" create=yes mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/hostname state=present regexp="^" line="{{ inventory_hostname }}" create=yes mode=0640 - name: increase the mesos-agent executor timeout - lineinfile: dest=/etc/mesos-agent/executor_registration_timeout state=present line="5mins" regexp="^" create=yes mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/executor_registration_timeout state=present line="5mins" regexp="^" create=yes mode=0640 - name: add containerizer to the mesos-agent - lineinfile: dest=/etc/mesos-agent/containerizers state=present line="docker,mesos" regexp="^" create=yes mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/containerizers state=present line="docker,mesos" regexp="^" create=yes mode=0640 - name: add mesos-agent credentials - lineinfile: dest=/etc/mesos-agent/credential state=present line="/etc/mesos/credential" regexp="^" create=yes mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/credential state=present line="/etc/mesos/credential" regexp="^" create=yes mode=0640 - name: add mesos-agent http credentials - lineinfile: dest=/etc/mesos-agent/http_credentials state=present line="/etc/mesos/http_credentials" regexp="^" create=yes mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/http_credentials state=present line="/etc/mesos/http_credentials" regexp="^" create=yes mode=0640 - name: enable cluster http readonly authentication - lineinfile: dest=/etc/mesos-agent/authenticate_http_readonly state=present create=yes regexp="^" line="true" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/authenticate_http_readonly state=present create=yes regexp="^" line="true" mode=0640 - name: enable cluster http readwrite authentication - lineinfile: dest=/etc/mesos-agent/authenticate_http_readwrite state=present create=yes regexp="^" line="true" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/authenticate_http_readwrite state=present create=yes regexp="^" line="true" mode=0640 - name: enable cluster http authenticators - lineinfile: dest=/etc/mesos-agent/http_authenticators state=present create=yes regexp="^" line="basic" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/http_authenticators state=present create=yes regexp="^" line="basic" mode=0640 - name: add weave.socks to the mesos-agent - lineinfile: dest=/etc/mesos-agent/docker_socket state=present line="/var/run/weave/weave.sock" regexp="^" create=yes mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/docker_socket state=present line="/var/run/weave/weave.sock" regexp="^" create=yes mode=0640 - name: set slave ip in mesos - lineinfile: dest=/etc/mesos-agent/ip state=present create=yes regexp="^" line="{{ mesos_ip_address }}" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/ip state=present create=yes regexp="^" line="{{ client_address }}" mode=0640 - name: disable hostname lookup - lineinfile: dest=/etc/mesos-agent/hostname_lookup state=present create=yes regexp="^" line="false" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/hostname_lookup state=present create=yes regexp="^" line="false" mode=0640 - name: set memory profiling - lineinfile: dest=/etc/mesos-agent/memory_profiling state=present create=yes regexp="^" line="true" mode=0640 - -- name: set mesos isolation - lineinfile: dest=/etc/mesos-agent/isolation state=present create=yes regexp="^" line="cgroups/all,disk/du,network/cni,filesystem/linux,docker/runtime,volume/sandbox_path,volume/secret,posix/rlimits,namespaces/pid,linux/capabilities" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/memory_profiling state=present create=yes regexp="^" line="true" mode=0640 + +- name: set mesos isolation centos and ubunut + lineinfile: + dest: "{{ mesos_etc_dir }}/isolation" + state: present + create: yes + regexp: "^" + line: "cgroups/all,disk/du,network/cni,filesystem/linux,docker/runtime,volume/sandbox_path,volume/secret,posix/rlimits,namespaces/pid,linux/capabilities" + mode: 0640 + when: + ansible_distribution == "Ubuntu" or ansible_os_family == "RedHat" + +- name: set mesos isolation debian + lineinfile: + dest: "{{ mesos_etc_dir }}/isolation" + state: present + create: yes + regexp: "^" + line: "cgroups/all,disk/du,network/cni,filesystem/linux,docker/runtime,volume/sandbox_path,volume/secret,posix/rlimits,namespaces/pid" + mode: 0640 + when: + ansible_distribution == "Debian" - name: set image provider - lineinfile: dest=/etc/mesos-agent/image_providers state=present create=yes regexp="^" line="appc,docker" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/image_providers state=present create=yes regexp="^" line="appc,docker" mode=0640 - name: set mesos module directory - lineinfile: dest=/etc/mesos-agent/modules_dir state=present create=yes regexp="^" line="/etc/mesos/modules" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/modules_dir state=present create=yes regexp="^" line="/etc/mesos/modules" mode=0640 - name: set mesos work-dir - lineinfile: dest=/etc/mesos-agent/work_dir state=present create=yes regexp="^" line="/var/lib/mesos" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/work_dir state=present create=yes regexp="^" line="/var/lib/mesos" mode=0640 + +- name: set mesos webui-dir + lineinfile: dest=/etc/mesos-master/webui_dir state=present create=yes regexp="^" line="/usr/share/mesos/webui" mode=0755 - name: set mesos cni plugins dir - lineinfile: dest=/etc/mesos-agent/network_cni_plugins_dir state=present create=yes regexp="^" line="/usr/libexec/cni/bin" mode=0640 + lineinfile: dest={{ mesos_etc_dir }}/network_cni_plugins_dir state=present create=yes regexp="^" line="/usr/libexec/cni/bin" mode=0640 - name: set mesos executor env with ssl template: src: executor.json.js - dest: /etc/mesos-agent/executor_environment_variables + dest: "{{ mesos_etc_dir }}/executor_environment_variables" mode: 0640 when: - libprocess_enable_ssl == "true" - name: set mesos executor env without ssl file: - path: /etc/mesos-agent/executor_environment_variables + path: "{{ mesos_etc_dir }}/executor_environment_variables" state: absent when: - libprocess_enable_ssl == "false" @@ -189,7 +238,7 @@ - name: set mesos container dns template: src: container_dns.j2 - dest: /etc/mesos-agent/default_container_dns + dest: "{{ mesos_etc_dir }}/default_container_dns" mode: 0640 - name: create mesos module directory @@ -222,9 +271,10 @@ - name: copy mesos http credential template: src=http_credentials.j2 dest=/etc/mesos/http_credentials mode=0640 -- name: ensure mesos-agent service is started and enabled +- name: start necessary services service: name: "{{ item }}" + daemon_reload: true enabled: yes state: restarted with_items: @@ -234,8 +284,7 @@ - name: ensure mesos-master service is disabled service: - name: "{{ item }}" + name: mesos-master enabled: no state: stopped - with_items: - - mesos-master + ignore_errors: true diff --git a/plays/roles/mesos-dns/defaults/main.yaml b/plays/roles/mesos-dns/defaults/main.yaml index 369ac3b..e02e8f0 100644 --- a/plays/roles/mesos-dns/defaults/main.yaml +++ b/plays/roles/mesos-dns/defaults/main.yaml @@ -1,6 +1,6 @@ --- mesos_password: "marathon" mesos_user: "mesos" -mesos_dns_version: "v0.8.1" +mesos_dns_version: "0.8.2" libprocess_enable_ssl: "false" diff --git a/plays/roles/mesos-dns/tasks/main.yml b/plays/roles/mesos-dns/tasks/main.yml index 9942cf1..1135ce1 100644 --- a/plays/roles/mesos-dns/tasks/main.yml +++ b/plays/roles/mesos-dns/tasks/main.yml @@ -21,18 +21,24 @@ system: yes state: present +- debug: + var: ansible_os_family + + - name: enable mesos-dns update lineinfile: dest: "/etc/yum.conf" regexp: "^exclude=mesos*" line: '#exclude=mesos* docker* ceph* zookeeper* marathon*' state: present + when: + ansible_os_family == "RedHat" - name: install mesos-dns - yum: + package: name: - - "mesos-dns-{{ mesos_dns_version }}" - state: installed + - "mesos-dns" + state: present - name: disable mesos-dns update lineinfile: @@ -40,8 +46,8 @@ regexp: "^#exclude=mesos*" line: 'exclude=mesos* docker* ceph* zookeeper* marathon*' state: present - - + when: + ansible_os_family == "RedHat" - name: Set file permission file: diff --git a/plays/roles/mesos-master/defaults/main.yaml b/plays/roles/mesos-master/defaults/main.yaml index d57725a..0034980 100644 --- a/plays/roles/mesos-master/defaults/main.yaml +++ b/plays/roles/mesos-master/defaults/main.yaml @@ -12,12 +12,11 @@ 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 }}" - libprocess_ssl_hostname_validation_scheme: "openssl" diff --git a/plays/roles/mesos-master/tasks/main.yml b/plays/roles/mesos-master/tasks/main.yml index 6eee6f8..3d1057b 100644 --- a/plays/roles/mesos-master/tasks/main.yml +++ b/plays/roles/mesos-master/tasks/main.yml @@ -6,13 +6,37 @@ regexp: "^exclude=mesos*" line: '#exclude=mesos* docker* ceph* zookeeper* marathon*' state: present + when: + ansible_os_family == "RedHat" -- name: install mesos master packages - yum: +- name: install mesos master packages centos + package: name: - apr-util - "{{ mesos_rpm }}" - state: latest + state: present + when: + ansible_os_family == "RedHat" + +- name: BUGFIX - install nss package to prevent dependencies problems with mesos-agent + package: + name: + - libcurl4-nss-dev + state: present + when: + ansible_os_family == "Debian" + +- name: install mesos master packages ubuntu + package: + name: + - libsvn1 + - libsasl2-modules + - libevent-dev + - libcurl4-openssl-dev + - "{{ mesos_deb }}" + state: present + when: + ansible_os_family == "Debian" - name: disable mesos update lineinfile: @@ -20,6 +44,8 @@ regexp: "^#exclude=mesos*" line: 'exclude=mesos* docker* ceph* zookeeper* marathon*' state: present + when: + ansible_os_family == "RedHat" - name: Remove deprecated config files file: @@ -105,7 +131,7 @@ lineinfile: dest=/etc/mesos-master/hostname state=present regexp="^" line="{{ inventory_hostname }}" create=yes - name: set master ip in mesos - lineinfile: dest=/etc/mesos-master/ip state=present create=yes regexp="^" line="{{ mesos_ip_address }}" + lineinfile: dest=/etc/mesos-master/ip state=present create=yes regexp="^" line="{{ client_address }}" - name: set cluster hostname lineinfile: dest=/etc/mesos-master/cluster state=present create=yes regexp="^" line="{{ mesos_clustername }}" @@ -155,6 +181,9 @@ - name: set mesos work-dir lineinfile: dest=/etc/mesos-master/work_dir state=present create=yes regexp="^" line="/var/lib/mesos" mode=0755 +- name: set mesos webui-dir + lineinfile: dest=/etc/mesos-master/webui_dir state=present create=yes regexp="^" line="/usr/share/mesos/webui" mode=0755 + - name: create mesos module directory file: path: /etc/mesos/modules @@ -168,11 +197,12 @@ template: src=acls.j2 dest=/etc/mesos/acls mode=0640 - name: copy marathon secret - template: src=marathon.secret.j2 dest=/etc/mesos/marathon.secret mode=0640 + template: src=marathon.secret.j2 dest=/etc/mesos/marathon.secret mode=0640 - name: start necessary services service: name: "{{ item }}" + daemon_reload: true enabled: yes state: restarted with_items: diff --git a/plays/roles/os/tasks/main.yml b/plays/roles/os/tasks/main.yml new file mode 100644 index 0000000..ce230e1 --- /dev/null +++ b/plays/roles/os/tasks/main.yml @@ -0,0 +1,42 @@ +--- + +- name: UNSUPPORTED - disable cgroup hierarchy + lineinfile: + dest: "/etc/default/grub.d/cgroup.cfg" + state: present + create: yes + regexp: "^" + line: "systemd.unified_cgroup_hierarchy=false" + mode: 0640 + when: + ansible_distribution == "Debian" + +- name: "get facts of installed packages" + package_facts: + manager: "auto" + +- name: update repository cache ubuntu + apt: + update_cache: true + when: + ansible_os_family == "Debian" + +- name: install os packages + package: + name: + - gnupg + state: present + +- name: deactivate selinux permanent + lineinfile: + dest: /etc/sysconfig/selinux + regexp: ^SELINUX= + line: SELINUX=disabled + state: present + create: yes + when: "'policycoreutils' is in ansible_facts.packages" + +- name: deactivate selinux temp + command: setenforce 0 + when: "'policycoreutils' is in ansible_facts.packages" + diff --git a/plays/roles/repos/tasks/main.yml b/plays/roles/repos/tasks/main.yml index 3d073ea..6b7885b 100644 --- a/plays/roles/repos/tasks/main.yml +++ b/plays/roles/repos/tasks/main.yml @@ -4,5 +4,26 @@ src: aventer-rel.repo dest: /etc/yum.repos.d/aventer-rel.repo mode: 0640 + when: + ansible_os_family == "RedHat" + +- name: add aventer gpg-key + apt_key: + url: https://www.aventer.biz/assets/support_aventer.asc + state: present + when: + ansible_os_family == "Debian" + +- debug: msg="{{ ansible_distribution }}" + +- name: add aventer apt repository + apt_repository: + repo: "deb http://rpm.aventer.biz/{{ ansible_distribution }} {{ ansible_lsb.codename|lower }} main" + state: present + filename: aventer + update_cache: yes + when: + ansible_os_family == "Debian" + diff --git a/plays/roles/weave/defaults/main.yaml b/plays/roles/weave/defaults/main.yaml index f9a4010..e814b15 100644 --- a/plays/roles/weave/defaults/main.yaml +++ b/plays/roles/weave/defaults/main.yaml @@ -3,3 +3,5 @@ weave_version: "v2.8.1" weave_password: "changeme" weave_fastd: "false" + +mesos_etc_dir: "/etc/mesos-agent" diff --git a/plays/roles/weave/tasks/main.yml b/plays/roles/weave/tasks/main.yml index e80d00a..bbcef93 100644 --- a/plays/roles/weave/tasks/main.yml +++ b/plays/roles/weave/tasks/main.yml @@ -21,7 +21,7 @@ state: present - name: copy Weave systemd docker config for Mesos slave - copy: src=docker_socket dest=/etc/mesos-agent/ mode=0644 + copy: src=docker_socket dest={{ mesos_etc_dir }}/ mode=0644 - name: copy Weave env template: src=weave.env.j2 dest=/etc/weave.env mode=0644 diff --git a/plays/roles/weave_plugin_mesos/defaults/main.yaml b/plays/roles/weave_plugin_mesos/defaults/main.yaml new file mode 100644 index 0000000..68e09eb --- /dev/null +++ b/plays/roles/weave_plugin_mesos/defaults/main.yaml @@ -0,0 +1,3 @@ +--- + +mesos_etc_dir: "/etc/mesos-agent" diff --git a/plays/roles/weave_plugin_mesos/tasks/main.yml b/plays/roles/weave_plugin_mesos/tasks/main.yml index 9295a11..557059a 100644 --- a/plays/roles/weave_plugin_mesos/tasks/main.yml +++ b/plays/roles/weave_plugin_mesos/tasks/main.yml @@ -8,7 +8,7 @@ - name: add cni config dir lineinfile: - dest: /etc/mesos-agent/network_cni_config_dir + dest: "{{ mesos_etc_dir }}/network_cni_config_dir" state: present line: "/etc/mesos/cni/net.d" create: yes diff --git a/plays/roles/zookeeper/defaults/main.yaml b/plays/roles/zookeeper/defaults/main.yaml index 06af353..7b26664 100644 --- a/plays/roles/zookeeper/defaults/main.yaml +++ b/plays/roles/zookeeper/defaults/main.yaml @@ -2,5 +2,6 @@ zookeeper_admin_secret: "zookeeper" zookeeper_client_secret: "zookeeper" +zookeeper_version: "3.8.0" diff --git a/plays/roles/zookeeper/tasks/main.yml b/plays/roles/zookeeper/tasks/main.yml index f9f643f..ab61941 100644 --- a/plays/roles/zookeeper/tasks/main.yml +++ b/plays/roles/zookeeper/tasks/main.yml @@ -6,12 +6,27 @@ regexp: "^exclude=mesos*" line: '#exclude=mesos* docker* ceph* zookeeper* marathon*' state: present + when: + ansible_os_family == "RedHat" -- name: install zookeeper packages - yum: + +- name: install zookeeper packages ubuntu + package: name: - - aventer-zookeeper-3.7.0 - state: installed + - openjdk-17-jdk + - aventer-zookeeper + state: present + when: + ansible_os_family == "Debian" + +- name: install zookeeper packages centos + package: + name: + - java-1.6.0-openjdk.x86_64 + - aventer-zookeeper + state: present + when: + ansible_os_family == "RedHat" - name: disable zookeeper update lineinfile: @@ -19,6 +34,8 @@ regexp: "^#exclude=mesos*" line: 'exclude=mesos* docker* ceph* zookeeper* marathon*' state: present + when: + ansible_os_family == "RedHat" - name: enable zookeeper authentication lineinfile: dest=/etc/zookeeper/conf/java.env state=present regexp="^" line="SERVER_JVMFLAGS=\"-Djava.security.auth.login.config=/etc/zookeeper/conf/jaas.conf\"" create=yes diff --git a/plays/server-config.yaml b/plays/server-config.yaml index 665cc97..cab6978 100644 --- a/plays/server-config.yaml +++ b/plays/server-config.yaml @@ -1,13 +1,13 @@ - name: gather all hosts information hosts: all -- name: Configure CENTOS +- name: Configure OS become: yes hosts: - manager - worker roles: - - role: centos + - role: os tags: - manager - worker @@ -66,6 +66,11 @@ hosts: worker serial: 40% roles: + - role: mesos-agent + tags: + - mesos + - mesos-agent + - worker - role: docker tags: - docker @@ -74,11 +79,6 @@ tags: - weave - worker - - role: mesos-agent - tags: - - mesos - - mesos-agent - - worker - role: mesos-ssl tags: - mesos @@ -100,11 +100,13 @@ serial: 40% roles: - role: marathon + when: + ansible_os_family == "RedHat" tags: - marathon - role: marathon-ssl tags: - marathon - ssl - when: libprocess_enable_ssl|bool == True + when: libprocess_enable_ssl|bool == True and ansible_os_family == "RedHat"