summaryrefslogtreecommitdiffstats
path: root/src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml
diff options
context:
space:
mode:
Diffstat (limited to 'src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml')
-rw-r--r--src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml155
1 files changed, 155 insertions, 0 deletions
diff --git a/src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml b/src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml
new file mode 100644
index 000000000..e5185e3fc
--- /dev/null
+++ b/src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml
@@ -0,0 +1,155 @@
+---
+# Defines deployment design and assigns role to server groups
+
+- hosts:
+ - mons
+ - osds
+ - mgrs
+
+ gather_facts: false
+ any_errors_fatal: true
+ become: true
+
+ tags:
+ - always
+
+ vars:
+ delegate_facts_host: True
+ dashboard_enabled: False
+
+ environment:
+ DEBIAN_FRONTEND: noninteractive
+
+ pre_tasks:
+ # If we can't get python2 installed before any module is used we will fail
+ # so just try what we can to get it installed
+ - name: check for python2
+ stat:
+ path: /usr/bin/python
+ ignore_errors: yes
+ register: systempython2
+
+ - name: install python2 for debian based systems
+ raw: sudo apt-get -y install python-simplejson
+ ignore_errors: yes
+ when:
+ - systempython2.stat is undefined or systempython2.stat.exists == false
+
+ # Ansible will try to auto-install python-apt, in some systems this might be
+ # python3-apt, or python-apt, and it has caused whole runs to fail because
+ # it is trying to do an interactive prompt
+ - name: install python-apt and aptitude in debian based systems
+ raw: sudo apt-get -y install "{{ item }}"
+ ignore_errors: yes
+ with_items:
+ - python3-apt
+ - python-apt
+ - aptitude
+
+ - name: install python2 for fedora
+ raw: sudo dnf -y install python creates=/usr/bin/python
+ ignore_errors: yes
+ when:
+ - systempython2.stat is undefined or systempython2.stat.exists == false
+
+ - name: install python2 for opensuse
+ raw: sudo zypper -n install python-base creates=/usr/bin/python2.7
+ ignore_errors: yes
+ when:
+ - systempython2.stat is undefined or systempython2.stat.exists == false
+
+ - name: gather facts
+ setup:
+ when:
+ - not delegate_facts_host | bool
+
+ - name: gather and delegate facts
+ setup:
+ delegate_to: "{{ item }}"
+ delegate_facts: True
+ with_items: "{{ groups['all'] }}"
+ run_once: true
+ when:
+ - delegate_facts_host | bool
+
+ - name: install required packages for fedora > 23
+ raw: sudo dnf -y install python2-dnf libselinux-python ntp
+ when:
+ - ansible_facts['distribution'] == 'Fedora'
+ - ansible_facts['distribution_major_version']|int >= 23
+
+ - name: check if it is atomic host
+ stat:
+ path: /run/ostree-booted
+ register: stat_ostree
+
+ - name: set_fact is_atomic
+ set_fact:
+ is_atomic: '{{ stat_ostree.stat.exists }}'
+
+ tasks:
+ - import_role:
+ name: ceph-defaults
+ - import_role:
+ name: ceph-facts
+ - import_role:
+ name: ceph-validate
+
+- hosts:
+ - mons
+ - osds
+ - mgrs
+ gather_facts: false
+ become: True
+ any_errors_fatal: true
+ vars:
+ dashboard_enabled: False
+ tasks:
+ - import_role:
+ name: ceph-defaults
+ - import_role:
+ name: ceph-facts
+ - import_role:
+ name: ceph-handler
+ - import_role:
+ name: ceph-common
+
+ - name: rsync ceph-volume to test nodes on centos
+ synchronize:
+ src: "{{ toxinidir }}/../../../../ceph_volume"
+ dest: "/usr/lib/python3.6/site-packages"
+ use_ssh_args: true
+ when:
+ - ansible_facts['os_family'] == "RedHat"
+ - inventory_hostname in groups.get(osd_group_name, [])
+
+ - name: rsync ceph-volume to test nodes on ubuntu
+ synchronize:
+ src: "{{ toxinidir }}/../../../../ceph_volume"
+ dest: "/usr/lib/python2.7/dist-packages"
+ use_ssh_args: true
+ when:
+ - ansible_facts['os_family'] == "Debian"
+ - inventory_hostname in groups.get(osd_group_name, [])
+
+ - name: run ceph-config role
+ import_role:
+ name: ceph-config
+
+ - name: run ceph-mon role
+ import_role:
+ name: ceph-mon
+ when:
+ - inventory_hostname in groups.get(mon_group_name, [])
+
+ - name: run ceph-mgr role
+ import_role:
+ name: ceph-mgr
+ when:
+ - inventory_hostname in groups.get(mgr_group_name, [])
+
+ - name: run ceph-osd role
+ import_role:
+ name: ceph-osd
+ when:
+ - inventory_hostname in groups.get(osd_group_name, [])