Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion roles/common/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- name: sysctl update
command: sysctl -p
command: sysctl -p
# ignore_errors: true
48 changes: 48 additions & 0 deletions roles/common/tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
- name: Install base packages
yum: name={{item}} state=installed
with_items:
- curl
- unzip
- ca-certificates

- name: check kernel version
shell: uname -r| tr -d '.|-' |cut -c 1-7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, interesting way to get the version. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was in a hurry, suggestions are welcomed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the goal is to upgrade the kernel firmware, so suggest we do this by first enable the centosplus repo which seems to be the official source of the kernel-firmware:

- name: Add CentOSPlus RPM repository
  yumrepo:
    name: centosplus
    baseurl: http://mirror.centos.org/centos/$releasever/centosplus/$basearch
    mirrorlist: http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    gpgcheck=yes
    includepkgs=kernel-firmware-*

and then use the yum task to force installation of the version listed below

register: version

- name: uninstall firmware
yum: name={{item}} state=removed
with_items:
- kernel-firmware
when: "'{{version.stdout}}' != '2632573'"
register: newkernel

- name: update kernel-firmware
get_url: dest=/home/{{ansible_ssh_user}}/kernel-firmware.rpm url=ftp://fr2.rpmfind.net/linux/centos/6.7/centosplus/x86_64/Packages/kernel-firmware-2.6.32-573.18.1.el6.centos.plus.noarch.rpm mode=0644
sudo: false
when: newkernel.changed

- shell: rpm -if /home/{{ansible_ssh_user}}/kernel-firmware.rpm
sudo: true
when: newkernel.changed

- name: Update kernel
yum: name=kernel-debug state=latest
sudo: true
when: newkernel.changed

- shell: grubby --set-default=/boot/vmlinuz-2.6.32-573.18.1.el6.x86_64.debug
sudo: true
when: newkernel.changed

- shell: sleep 2 && reboot
when: newkernel.changed
async: 1
poll: 0
sudo: true
ignore_errors: true

- name: waiting for server to come back
local_action: wait_for host={{ inventory_hostname }} state=started delay=15 timeout=120 port=22
sudo: false
when: newkernel.changed
13 changes: 13 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@
include: Debian.yml
when: ansible_os_family == "Debian"

- name: Conditionally install RedHat packages
include: RedHat.yml
when: ansible_os_family == "RedHat"

- name: Update /etc/hosts to list all cluster nodes
template: src=etc-hosts.j2 dest=/etc/hosts mode=0644

- name: disable ipv6 bridging
lineinfile: dest=/etc/sysctl.conf regexp="^net.bridge.bridge-nf-call-ip6tables" line="#net.bridge.bridge-nf-call-ip6tables = 0" state=present

- name: disable ipv6 bridging
lineinfile: dest=/etc/sysctl.conf regexp="^net.bridge.bridge-nf-call-iptables" line="#net.bridge.bridge-nf-call-iptables = 0" state=present

- name: disable ipv6 bridging
lineinfile: dest=/etc/sysctl.conf regexp="^net.bridge.bridge-nf-call-arptables" line="#net.bridge.bridge-nf-call-arptables = 0" state=present

- name: disable ipv6
lineinfile: dest=/etc/sysctl.conf regexp="^net.ipv6.conf.all.disable_ipv6" line="net.ipv6.conf.all.disable_ipv6 = 1" state=present
notify: sysctl update
8 changes: 6 additions & 2 deletions roles/dcos-cli/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
# and Marathon endpoints.
---
- name: Install PIP
apt: name=python-pip state=installed
apt: name=python-pip state=latest

- name: Install DCOS CLI
pip: name=dcoscli state=present
pip: name={{item}} state=latest
with_items:
- dcoscli
- six
- requests

- name: Create DCOS CLI config directory
file: path=~/.dcos state=directory mode=0700
Expand Down
10 changes: 9 additions & 1 deletion roles/mesos-agent/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
- name: Restart agent service
service: name=mesos-slave state=restarted
service: name=mesos-slave state=stopped
notify: remove-metadata

- name: remove-metadata
file: path={{work_dir}}/meta state=absent
notify: start-agent

- name: start-agent
service: name=mesos-slave state=started
7 changes: 5 additions & 2 deletions roles/mesos-agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@
#
# Depends on the [mesos](mesos.md) role.
---
- name: Set agent facts
set_fact: work_dir=/log/mesos

- name: Configure agent
copy: content={{item.content}} dest={{item.file}}
with_items:
- { file: '/etc/mesos/zk', content: "{{mesos_zk_url}}" }
- { file: '/etc/mesos-slave/hostname', content: "{{mesos_hostname}}" }
- { file: '/etc/mesos-slave/containerizers', content: 'docker,mesos' }
- { file: '/etc/mesos-slave/isolation', content: 'cgroups/cpu,cgroups/mem' }
- { file: '/etc/mesos-slave/executor_registration_timeout', content: '5mins' }
- { file: '/etc/mesos-slave/executor_registration_timeout', content: '2mins' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for lowering this? For large docker images I think it is better to have this higher to increase the change of the download succeeding before the Mesos task fails

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually takes less than a minute, but sometimes connection fails. I will revert, if we ever see timeout on slow connections

- { file: '/etc/mesos-slave/attributes', content: "{{agent_attributes}}" }
- { file: '/etc/mesos-slave/resources', content: "{{agent_resources}}" }
- { file: '/etc/mesos-slave/credential', content: '/etc/mesos-slave/.credentials' }
- { file: '/etc/mesos-slave/fetcher_cache_size', content: "2GB" }
- { file: '/etc/mesos-slave/fetcher_cache_dir', content: "/tmp/mesos" }
- { file: '/etc/mesos-slave/work_dir', content: "/log/mesos" }
- { file: '/etc/mesos-slave/work_dir', content: "{{work_dir}}" }
notify: Restart agent service

- name: Configure default limits and logs
Expand Down
2 changes: 1 addition & 1 deletion roles/mesos-master/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Depends on the [mesos](mesos.md) role.
---
- name: Install Mesos master packages
apt: name={{item}} state=installed
apt: name={{item}} state=installed force=yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is force=yes needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure it's needed, but helpful in case of downgrading

with_items:
- marathon={{marathon_version}}*
- chronos={{chronos_version}}*
Expand Down
2 changes: 1 addition & 1 deletion roles/mesos/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
apt_repository: repo="deb http://repos.mesosphere.io/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main" state=present

- name: Install Mesos package
apt: name={{item}} state=installed
apt: name={{item}} state=installed force=yes
with_items:
- mesos={{mesos_version}}*

Expand Down