ef3f20
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
ef3f20
%{!?license: %global license %%doc}
ef3f20
ef3f20
# The only reason we are archful is because dmidecode is ExclusiveArch
ef3f20
# https://bugzilla.redhat.com/show_bug.cgi?id=1067089
ef3f20
%global debug_package %{nil}
ef3f20
ef3f20
Name:           cloud-init
ef3f20
Version:        0.7.9
Karanbir Singh 0a9171
Release:        9%{?dist}.2
ef3f20
Summary:        Cloud instance init scripts
ef3f20
ef3f20
Group:          System Environment/Base
ef3f20
License:        GPLv3
ef3f20
URL:            http://launchpad.net/cloud-init
ef3f20
Source0:        https://launchpad.net/cloud-init/trunk/%{version}/+download/%{name}-%{version}.tar.gz
ef3f20
Source1:        cloud-init-rhel.cfg
ef3f20
Source2:        cloud-init-README.rhel
ef3f20
Source3:        cloud-init-tmpfiles.conf
ef3f20
ef3f20
# The following line stops 'rdopkg update-patches' from inserting Patch
ef3f20
# directives in the middle of our Source directives.
ef3f20
#
ef3f20
# patches_base=0.7.9
ef3f20
Patch0001: 0001-configuration-changes-for-RHEL-package.patch
ef3f20
Patch0002: 0002-do-not-use-git-to-determine-version.patch
ef3f20
Patch0003: 0003-util-teach-write_file-about-copy_mode-option.patch
ef3f20
Patch0004: 0004-Do-not-write-NM_CONTROLLED-no-in-generated-interface.patch
ef3f20
Patch0005: 0005-url_helper-fail-gracefully-if-oauthlib-is-not-availa.patch
ef3f20
Patch0006: 0006-rsyslog-replace-with-stop.patch
ef3f20
Patch0007: 0007-OpenStack-Use-timeout-and-retries-from-config-in-get.patch
ef3f20
Patch0008: 0008-correct-errors-in-cloudinit-net-sysconfig.py.patch
ef3f20
Patch0009: 0009-net-do-not-raise-exception-for-3-nameservers.patch
ef3f20
Patch0010: 0010-net-support-both-ipv4-and-ipv6-gateways-in-sysconfig.patch
ef3f20
Patch0011: 0011-systemd-replace-generator-with-unit-conditionals.patch
ef3f20
Patch0012: 0012-OpenStack-add-dvs-to-the-list-of-physical-link-types.patch
ef3f20
Patch0013: 0013-Bounce-network-interface-for-Azure-when-using-the-bu.patch
ef3f20
Patch0014: 0014-limit-permissions-on-def_log_file.patch
ef3f20
Patch0015: 0015-remove-tee-command-from-logging-configuration.patch
ef3f20
Patch0016: 0016-add-power-state-change-module-to-cloud_final_modules.patch
ef3f20
Patch0017: 0017-sysconfig-Raise-ValueError-when-multiple-default-gat.patch
ef3f20
Patch0018: 0018-Fix-dual-stack-IPv4-IPv6-configuration-for-RHEL.patch
ef3f20
Patch0019: 0019-Add-missing-sysconfig-unit-test-data.patch
ef3f20
Patch0020: 0020-Fix-ipv6-subnet-detection.patch
ef3f20
Patch0021: 0021-azure-ensure-that-networkmanager-hook-script-runs.patch
ef3f20
Patch0022: 0022-RHEL-CentOS-Fix-default-routes-for-IPv4-IPv6-configu.patch
4980c7
Patch9999: cloud-init-add-centos-os.patch
ef3f20
ef3f20
# Deal with noarch -> arch
ef3f20
# https://bugzilla.redhat.com/show_bug.cgi?id=1067089
ef3f20
Obsoletes:      cloud-init < 0.7.5-3
ef3f20
ef3f20
BuildRequires:  python-devel
ef3f20
BuildRequires:  python-setuptools
ef3f20
BuildRequires:  systemd-units
ef3f20
BuildRequires:  git
ef3f20
ef3f20
%ifarch %{?ix86} x86_64 ia64
ef3f20
Requires:       dmidecode
ef3f20
%endif
ef3f20
Requires:       e2fsprogs
ef3f20
Requires:       iproute
ef3f20
Requires:       libselinux-python
ef3f20
Requires:       net-tools
ef3f20
Requires:       policycoreutils-python
ef3f20
Requires:       procps
ef3f20
Requires:       python-configobj
ef3f20
Requires:       python-jinja2
ef3f20
Requires:       python-jsonpatch
ef3f20
Requires:       python-prettytable
ef3f20
Requires:       python-requests
ef3f20
Requires:       python-setuptools
ef3f20
Requires:       PyYAML
ef3f20
Requires:       pyserial
ef3f20
Requires:       shadow-utils
ef3f20
Requires(post):   systemd-units
ef3f20
Requires(preun):  systemd-units
ef3f20
Requires(postun): systemd-units
ef3f20
ef3f20
%description
ef3f20
Cloud-init is a set of init scripts for cloud instances.  Cloud instances
ef3f20
need special scripts to run during initialization to retrieve and install
ef3f20
ssh keys and to let the user run various scripts.
ef3f20
ef3f20
ef3f20
%prep
ef3f20
# on el7, autosetup -S git was failing with patches that
ef3f20
# create new files.  rpm 4.11.3 and later has -S git_am, but
ef3f20
# el7 only has 4.11.1.
ef3f20
%autosetup -p1 -n %{name}-%{version} -S git
ef3f20
ef3f20
ef3f20
%build
ef3f20
%{__python} setup.py build
ef3f20
ef3f20
ef3f20
%install
ef3f20
rm -rf $RPM_BUILD_ROOT
ef3f20
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
ef3f20
ef3f20
# Don't ship the tests
ef3f20
rm -r $RPM_BUILD_ROOT%{python_sitelib}/tests
ef3f20
ef3f20
mkdir -p $RPM_BUILD_ROOT/var/lib/cloud
ef3f20
ef3f20
# /run/cloud-init needs a tmpfiles.d entry
ef3f20
mkdir -p $RPM_BUILD_ROOT/run/cloud-init
ef3f20
mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir}
ef3f20
cp -p rhel/cloud-init-tmpfiles.conf $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}.conf
ef3f20
ef3f20
# We supply our own config file since our software differs from Ubuntu's.
ef3f20
cp -p rhel/cloud.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/cloud/cloud.cfg
ef3f20
ef3f20
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d
ef3f20
cp -p tools/21-cloudinit.conf $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
ef3f20
ef3f20
# Make installed NetworkManager hook name less generic
ef3f20
mv $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/hook-network-manager \
ef3f20
   $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/cloud-init-azure-hook
ef3f20
ef3f20
# Install our own systemd units (rhbz#1440831)
ef3f20
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
ef3f20
cp rhel/systemd/* $RPM_BUILD_ROOT%{_unitdir}/
ef3f20
ef3f20
ef3f20
%clean
ef3f20
rm -rf $RPM_BUILD_ROOT
ef3f20
ef3f20
ef3f20
%post
ef3f20
if [ $1 -eq 1 ] ; then
ef3f20
    # Initial installation
ef3f20
    # Enabled by default per "runs once then goes away" exception
ef3f20
    /bin/systemctl enable cloud-config.service     >/dev/null 2>&1 || :
ef3f20
    /bin/systemctl enable cloud-final.service      >/dev/null 2>&1 || :
ef3f20
    /bin/systemctl enable cloud-init.service       >/dev/null 2>&1 || :
ef3f20
    /bin/systemctl enable cloud-init-local.service >/dev/null 2>&1 || :
ef3f20
fi
ef3f20
ef3f20
%preun
ef3f20
if [ $1 -eq 0 ] ; then
ef3f20
    # Package removal, not upgrade
ef3f20
    /bin/systemctl --no-reload disable cloud-config.service >/dev/null 2>&1 || :
ef3f20
    /bin/systemctl --no-reload disable cloud-final.service  >/dev/null 2>&1 || :
ef3f20
    /bin/systemctl --no-reload disable cloud-init.service   >/dev/null 2>&1 || :
ef3f20
    /bin/systemctl --no-reload disable cloud-init-local.service >/dev/null 2>&1 || :
ef3f20
    # One-shot services -> no need to stop
ef3f20
fi
ef3f20
ef3f20
%postun
ef3f20
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
ef3f20
# One-shot services -> no need to restart
ef3f20
ef3f20
ef3f20
%files
ef3f20
%license LICENSE
ef3f20
%doc ChangeLog rhel/README.rhel
ef3f20
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
ef3f20
%dir               %{_sysconfdir}/cloud/cloud.cfg.d
ef3f20
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
ef3f20
%doc               %{_sysconfdir}/cloud/cloud.cfg.d/README
ef3f20
%dir               %{_sysconfdir}/cloud/templates
ef3f20
%config(noreplace) %{_sysconfdir}/cloud/templates/*
ef3f20
%{_unitdir}/cloud-config.service
ef3f20
%{_unitdir}/cloud-config.target
ef3f20
%{_unitdir}/cloud-final.service
ef3f20
%{_unitdir}/cloud-init-local.service
ef3f20
%{_unitdir}/cloud-init.service
ef3f20
%{_tmpfilesdir}/%{name}.conf
ef3f20
%{python_sitelib}/*
ef3f20
%{_libexecdir}/%{name}
ef3f20
%{_bindir}/cloud-init*
ef3f20
%doc %{_datadir}/doc/%{name}
ef3f20
%dir /run/cloud-init
ef3f20
%dir /var/lib/cloud
ef3f20
/etc/NetworkManager/dispatcher.d/cloud-init-azure-hook
ef3f20
%{_udevrulesdir}/66-azure-ephemeral.rules
ef3f20
ef3f20
%dir %{_sysconfdir}/rsyslog.d
ef3f20
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
ef3f20
ef3f20
%changelog
Karanbir Singh 0a9171
* Tue Sep  5 2017 Karanbir Singh <kbsingh@centos.org> 0.7.9-9.el7.centos.1
Karanbir Singh 0a9171
- Roll in CentOS Branding
Karanbir Singh 0a9171
- set default user to centos
Karanbir Singh 0a9171
- assume Red Hat compatibility
Karanbir Singh 0a9171
ef3f20
* Thu Jun 22 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-9
ef3f20
- RHEL/CentOS: Fix default routes for IPv4/IPv6 configuration. (rhbz#1438082)
ef3f20
- azure: ensure that networkmanager hook script runs (rhbz#1440831 rhbz#1460206)
ef3f20
- Fix ipv6 subnet detection (rhbz#1438082)
ef3f20
ef3f20
* Tue May 23 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-8
ef3f20
- Update patches
ef3f20
ef3f20
* Mon May 22 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-7
ef3f20
- Add missing sysconfig unit test data (rhbz#1438082)
ef3f20
- Fix dual stack IPv4/IPv6 configuration for RHEL (rhbz#1438082)
ef3f20
- sysconfig: Raise ValueError when multiple default gateways are present. (rhbz#1438082)
ef3f20
- Bounce network interface for Azure when using the built-in path. (rhbz#1434109)
ef3f20
- Do not write NM_CONTROLLED=no in generated interface config files (rhbz#1385172)
ef3f20
ef3f20
* Wed May 10 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-6
ef3f20
- add power-state-change module to cloud_final_modules (rhbz#1252477)
ef3f20
- remove 'tee' command from logging configuration (rhbz#1424612)
ef3f20
- limit permissions on def_log_file (rhbz#1424612)
ef3f20
- Bounce network interface for Azure when using the built-in path. (rhbz#1434109)
ef3f20
- OpenStack: add 'dvs' to the list of physical link types. (rhbz#1442783)
ef3f20
ef3f20
* Wed May 10 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-5
ef3f20
- systemd: replace generator with unit conditionals (rhbz#1440831)
ef3f20
ef3f20
* Thu Apr 13 2017 Charalampos Stratakis <cstratak@redhat.com> 0.7.9-4
ef3f20
- Import to RHEL 7
ef3f20
Resolves: rhbz#1427280
ef3f20
ef3f20
* Tue Mar 07 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-3
ef3f20
- fixes for network config generation
ef3f20
- avoid dependency cycle at boot (rhbz#1420946)
ef3f20
ef3f20
* Tue Jan 17 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-2
ef3f20
- use timeout from datasource config in openstack get_data (rhbz#1408589)
ef3f20
ef3f20
* Thu Dec 01 2016 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.9-1
ef3f20
- Rebased on upstream 0.7.9.
ef3f20
- Remove dependency on run-parts
ef3f20
ef3f20
* Wed Jan 06 2016 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-8
ef3f20
- make rh_subscription plugin do nothing in the absence of a valid
ef3f20
  configuration [RH:1295953]
ef3f20
- move rh_subscription module to cloud_config stage
ef3f20
ef3f20
* Wed Jan 06 2016 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-7
ef3f20
- correct permissions on /etc/ssh/sshd_config [RH:1296191]
ef3f20
ef3f20
* Thu Sep 03 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-6
ef3f20
- rebuild for ppc64le
ef3f20
ef3f20
* Tue Jul 07 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-5
ef3f20
- bump revision for new build
ef3f20
ef3f20
* Tue Jul 07 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-4
ef3f20
- ensure rh_subscription plugin is enabled by default
ef3f20
ef3f20
* Wed Apr 29 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-3
ef3f20
- added dependency on python-jinja2 [RH:1215913]
ef3f20
- added rhn_subscription plugin [RH:1227393]
ef3f20
- require pyserial to support smartos data source [RH:1226187]
ef3f20
ef3f20
* Fri Jan 16 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-2
ef3f20
- Rebased RHEL version to Fedora rawhide
ef3f20
- Backported fix for https://bugs.launchpad.net/cloud-init/+bug/1246485
ef3f20
- Backported fix for https://bugs.launchpad.net/cloud-init/+bug/1411829
ef3f20
ef3f20
* Fri Nov 14 2014 Colin Walters <walters@redhat.com> - 0.7.6-1
ef3f20
- New upstream version [RH:974327]
ef3f20
- Drop python-cheetah dependency (same as above bug)