ceph-mon: move the ceph_config call to ceph-mon role
[ceph-ansible.git] / ceph-ansible.spec.in
1 %global commit @COMMIT@
2 %global shortcommit %(c=%{commit}; echo ${c:0:7})
3
4 Name:           ceph-ansible
5 Version:        @VERSION@
6 Release:        @RELEASE@%{?dist}
7 Summary:        Ansible playbooks for Ceph
8 # Some files have been copied from Ansible (GPLv3+). For example:
9 #  plugins/actions/config_template.py
10 #  roles/ceph-common/plugins/actions/config_template.py
11 License:        ASL 2.0 and GPLv3+
12 URL:            https://github.com/ceph/ceph-ansible
13 Source0:        %{name}-%{version}-%{shortcommit}.tar.gz
14 Obsoletes:      ceph-iscsi-ansible <= 1.5
15
16 BuildArch:      noarch
17
18 BuildRequires: ansible >= 2.10
19 Requires: ansible >= 2.10
20
21 %if 0%{?rhel} == 7
22 BuildRequires: python2-devel
23 Requires: python2-netaddr
24 %else
25 BuildRequires: python3-devel
26 Requires: python3-netaddr
27 %endif
28
29 %description
30 Ansible playbooks for Ceph
31
32 %prep
33 %autosetup -p1
34
35 %build
36
37 %install
38 mkdir -p %{buildroot}%{_datarootdir}/ceph-ansible
39
40 for f in ansible.cfg *.yml *.sample group_vars roles library module_utils plugins infrastructure-playbooks; do
41   cp -a $f %{buildroot}%{_datarootdir}/ceph-ansible
42 done
43
44 pushd %{buildroot}%{_datarootdir}/ceph-ansible
45   # These untested playbooks are too unstable for users.
46   rm -r infrastructure-playbooks/untested-by-ci
47   %if ! 0%{?fedora} && ! 0%{?centos}
48     # remove ability to install ceph community version
49     rm roles/ceph-common/tasks/installs/redhat_{community,dev}_repository.yml
50     # Ship only the Red Hat Ceph Storage config (overwrite upstream settings)
51     cp group_vars/rhcs.yml.sample group_vars/all.yml.sample
52   %endif
53 popd
54
55 %check
56 # Borrowed from upstream's .travis.yml:
57 ansible-playbook -i dummy-ansible-hosts test.yml --syntax-check
58
59 %files
60 %doc README.rst
61 %license LICENSE
62 %{_datarootdir}/ceph-ansible
63
64 %changelog