2017-03-22 23:13:51 +08:00
|
|
|
---
|
2017-03-23 08:40:34 +08:00
|
|
|
- hosts: localhost
|
2017-03-22 23:13:51 +08:00
|
|
|
gather_facts: false
|
|
|
|
become: yes
|
|
|
|
tags:
|
|
|
|
- vagrant_setup
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: change centos/7 vagrant box name to rhel7
|
|
|
|
replace:
|
|
|
|
regexp: "centos/7"
|
|
|
|
replace: "rhel7"
|
2017-03-23 01:38:12 +08:00
|
|
|
dest: "{{ change_dir }}/vagrant_variables.yml"
|
2017-03-22 23:13:51 +08:00
|
|
|
when: change_dir is defined
|
|
|
|
|
2017-03-23 21:43:11 +08:00
|
|
|
- name: change ceph/ubuntu-xenial vagrant box name to rhel7
|
|
|
|
replace:
|
|
|
|
regexp: "ceph/ubuntu-xenial"
|
|
|
|
replace: "rhel7"
|
|
|
|
dest: "{{ change_dir }}/vagrant_variables.yml"
|
|
|
|
when: change_dir is defined
|
|
|
|
|
2017-04-11 02:39:16 +08:00
|
|
|
- name: change centos/atomic-host vagrant box name to rhel7
|
|
|
|
replace:
|
|
|
|
regexp: "centos/atomic-host"
|
|
|
|
replace: "rhel7"
|
|
|
|
dest: "{{ change_dir }}/vagrant_variables.yml"
|
|
|
|
when: change_dir is defined
|
|
|
|
|
2017-08-03 21:30:25 +08:00
|
|
|
- name: change ceph_origin to distro
|
2017-04-12 20:53:49 +08:00
|
|
|
replace:
|
2017-08-03 21:30:25 +08:00
|
|
|
regexp: "ceph_origin:.*"
|
|
|
|
replace: "ceph_origin: distro"
|
2017-04-12 20:53:49 +08:00
|
|
|
dest: "{{ change_dir }}/group_vars/all"
|
|
|
|
when: change_dir is defined
|
|
|
|
|
2017-08-03 21:30:25 +08:00
|
|
|
- name: change ceph_repository to rhcs
|
|
|
|
replace:
|
|
|
|
regexp: "ceph_repository:.*"
|
|
|
|
replace: "ceph_repository: rhcs"
|
2017-04-12 20:53:49 +08:00
|
|
|
dest: "{{ change_dir }}/group_vars/all"
|
|
|
|
when: change_dir is defined
|
|
|
|
|
2017-04-12 22:23:21 +08:00
|
|
|
- name: print contents of {{ change_dir }}/group_vars/all
|
|
|
|
command: "cat {{ change_dir }}/group_vars/all"
|
|
|
|
|
2017-03-22 23:13:51 +08:00
|
|
|
- hosts: all
|
|
|
|
gather_facts: true
|
|
|
|
become: yes
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: check if it is Atomic host
|
2017-08-03 21:30:25 +08:00
|
|
|
stat:
|
|
|
|
path: /run/ostree-booted
|
2017-03-22 23:13:51 +08:00
|
|
|
register: stat_ostree
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-03-22 23:13:51 +08:00
|
|
|
|
|
|
|
- name: set fact for using Atomic host
|
|
|
|
set_fact:
|
|
|
|
is_atomic: '{{ stat_ostree.stat.exists }}'
|
|
|
|
|
2017-03-23 05:18:57 +08:00
|
|
|
- name: install nightly rhel7 repo
|
|
|
|
get_url:
|
|
|
|
url: "{{ rhel7_repo_url }}"
|
|
|
|
dest: /etc/yum.repos.d
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
when: not is_atomic
|
|
|
|
|
2017-04-11 02:46:03 +08:00
|
|
|
- name: enable the rhel-7-extras-nightly repo
|
|
|
|
command: "yum-config-manager --enable rhel-7-extras-nightly"
|
|
|
|
|
2017-03-23 05:44:29 +08:00
|
|
|
- name: set MTU on eth0
|
|
|
|
command: "ifconfig eth0 mtu 1400 up"
|
|
|
|
|
|
|
|
- name: set MTU on eth1
|
|
|
|
command: "ifconfig eth1 mtu 1400 up"
|
|
|
|
|
2017-05-03 04:49:50 +08:00
|
|
|
- name: install docker
|
|
|
|
package:
|
|
|
|
name: docker
|
|
|
|
state: present
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-05-03 04:49:50 +08:00
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
|
|
|
- name: allow insecure docker registries
|
|
|
|
lineinfile:
|
|
|
|
line: 'INSECURE_REGISTRY="--insecure-registry {{ ceph_docker_registry }}"'
|
|
|
|
dest: "/etc/sysconfig/docker"
|
|
|
|
|
|
|
|
- name: restart docker
|
|
|
|
service:
|
|
|
|
name: docker
|
|
|
|
state: restarted
|
|
|
|
|
2017-04-22 01:45:33 +08:00
|
|
|
- hosts: mons:mgrs
|
2017-03-22 23:13:51 +08:00
|
|
|
gather_facts: false
|
|
|
|
become: yes
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: install ceph mon repo
|
|
|
|
yum_repository:
|
|
|
|
name: ceph-mon
|
|
|
|
description: repo for rhcs ceph-mon
|
|
|
|
baseurl: "{{ repo_url }}/MON/x86_64/os/"
|
|
|
|
gpgcheck: no
|
2017-03-23 04:42:17 +08:00
|
|
|
enabled: yes
|
2017-03-22 23:13:51 +08:00
|
|
|
when:
|
|
|
|
- not is_atomic
|
|
|
|
|
|
|
|
- hosts: osds
|
|
|
|
gather_facts: false
|
|
|
|
become: yes
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: install ceph osd repo
|
|
|
|
yum_repository:
|
|
|
|
name: ceph-osd
|
|
|
|
description: repo for rhcs ceph-osd
|
|
|
|
baseurl: "{{ repo_url }}/OSD/x86_64/os/"
|
|
|
|
gpgcheck: no
|
2017-03-23 04:42:17 +08:00
|
|
|
enabled: yes
|
2017-03-22 23:13:51 +08:00
|
|
|
when:
|
|
|
|
- not is_atomic
|
|
|
|
|
2017-03-23 05:44:29 +08:00
|
|
|
- name: set MTU on eth2
|
|
|
|
command: "ifconfig eth2 mtu 1400 up"
|
|
|
|
|
2017-10-25 22:53:34 +08:00
|
|
|
- hosts: mdss:rgws:clients
|
2017-03-22 23:13:51 +08:00
|
|
|
gather_facts: false
|
|
|
|
become: yes
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: install ceph tools repo
|
|
|
|
yum_repository:
|
|
|
|
name: ceph-osd
|
|
|
|
description: repo for rhcs ceph tools
|
2017-03-23 05:02:50 +08:00
|
|
|
baseurl: "{{ repo_url }}/Tools/x86_64/os/"
|
2017-03-22 23:13:51 +08:00
|
|
|
gpgcheck: no
|
2017-03-23 04:42:17 +08:00
|
|
|
enabled: yes
|
2017-03-22 23:13:51 +08:00
|
|
|
when:
|
|
|
|
- not is_atomic
|