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