Blame SPECS/cloud-init.spec

936480
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
936480
%{!?license: %global license %%doc}
936480
936480
# The only reason we are archful is because dmidecode is ExclusiveArch
936480
# https://bugzilla.redhat.com/show_bug.cgi?id=1067089
936480
%global debug_package %{nil}
936480
936480
Name:           cloud-init
936480
Version:        18.5
936480
Release:        5%{?dist}
936480
Summary:        Cloud instance init scripts
936480
936480
Group:          System Environment/Base
936480
License:        GPLv3
936480
URL:            http://launchpad.net/cloud-init
936480
Source0:        https://launchpad.net/cloud-init/trunk/%{version}/+download/%{name}-%{version}.tar.gz
936480
Source1:        cloud-init-tmpfiles.conf
936480
936480
Patch0001: 0001-Add-initial-redhat-setup.patch
936480
Patch0002: 0002-Do-not-write-NM_CONTROLLED-no-in-generated-interface.patch
936480
Patch0003: 0003-limit-permissions-on-def_log_file.patch
936480
Patch0004: 0004-remove-tee-command-from-logging-configuration.patch
936480
Patch0005: 0005-azure-ensure-that-networkmanager-hook-script-runs.patch
936480
Patch0006: 0006-sysconfig-Don-t-write-BOOTPROTO-dhcp-for-ipv6-dhcp.patch
936480
Patch0007: 0007-DataSourceAzure.py-use-hostnamectl-to-set-hostname.patch
936480
Patch0008: 0008-sysconfig-Don-t-disable-IPV6_AUTOCONF.patch
936480
Patch0009: 0009-net-Wait-for-dhclient-to-daemonize-before-reading-le.patch
936480
Patch0010: 0010-cloud-init-per-don-t-use-dashes-in-sem-names.patch
936480
Patch0011: 0011-azure-Filter-list-of-ssh-keys-pulled-from-fabric.patch
936480
Patch0012: 0012-include-NOZEROCONF-yes-in-etc-sysconfig-network.patch
936480
# For bz#1687565 - cloud-init 18.5 rebase for fast provisioning on Azure [RHEL 7]
936480
Patch13: ci-Azure-Ensure-platform-random_seed-is-always-serializ.patch
936480
# For bz#1687565 - cloud-init 18.5 rebase for fast provisioning on Azure [RHEL 7]
936480
Patch14: ci-DatasourceAzure-add-additional-logging-for-azure-dat.patch
936480
# For bz#1687565 - cloud-init 18.5 rebase for fast provisioning on Azure [RHEL 7]
936480
Patch15: ci-Azure-Changes-to-the-Hyper-V-KVP-Reporter.patch
936480
# For bz#1687565 - cloud-init 18.5 rebase for fast provisioning on Azure [RHEL 7]
936480
Patch16: ci-DataSourceAzure-Adjust-timeout-for-polling-IMDS.patch
936480
# For bz#1687565 - cloud-init 18.5 rebase for fast provisioning on Azure [RHEL 7]
936480
Patch17: ci-cc_mounts-check-if-mount-a-on-no-change-fstab-path.patch
936480
# For bz#1707725 - [WALA][cloud] cloud-init dhclient-hook script has some unexpected side-effects on Azure
936480
Patch18: ci-Revert-azure-ensure-that-networkmanager-hook-script-.patch
936480
# For bz#1726701 - [Azure] [RHEL 7.8] Cloud-init fixes to support fast provisioning for Azure
936480
Patch19: ci-Azure-Return-static-fallback-address-as-if-failed-to.patch
936480
# For bz#1593010 - [cloud-init][RHVM]cloud-init network configuration does not persist reboot [RHEL 7.8]
936480
Patch20: ci-Fix-for-network-configuration-not-persisting-after-r.patch
936480
936480
# Deal with noarch -> arch
936480
# https://bugzilla.redhat.com/show_bug.cgi?id=1067089
936480
Obsoletes:      cloud-init < 0.7.5-3
936480
936480
BuildRequires:  python-devel
936480
BuildRequires:  python-requests
936480
BuildRequires:  python-setuptools
936480
BuildRequires:  python-six
936480
BuildRequires:  python-yaml
936480
BuildRequires:  systemd-units
936480
BuildRequires:  git
936480
936480
%ifarch %{?ix86} x86_64 ia64
936480
Requires:       dmidecode
936480
%endif
936480
Requires:       e2fsprogs
936480
Requires:       iproute
936480
Requires:       libselinux-python
936480
Requires:       net-tools
936480
Requires:       policycoreutils-python
936480
Requires:       procps
936480
Requires:       python-configobj
936480
Requires:       python-jinja2
936480
Requires:       python-jsonpatch
936480
Requires:       python-prettytable
936480
Requires:       python-requests
936480
Requires:       python-setuptools
936480
Requires:       python-six
936480
Requires:       PyYAML
936480
Requires:       pyserial
936480
Requires:       shadow-utils
936480
Requires(post):   systemd-units
936480
Requires(preun):  systemd-units
936480
Requires(postun): systemd-units
936480
936480
%description
936480
Cloud-init is a set of init scripts for cloud instances.  Cloud instances
936480
need special scripts to run during initialization to retrieve and install
936480
ssh keys and to let the user run various scripts.
936480
936480
936480
%prep
936480
# on el7, autosetup -S git was failing with patches that
936480
# # create new files.  rpm 4.11.3 and later has -S git_am, but
936480
# # el7 only has 4.11.1.
936480
%autosetup -p1 -n %{name}-%{version} -S git
936480
936480
%build
936480
%{__python} setup.py build
936480
936480
936480
%install
936480
rm -rf $RPM_BUILD_ROOT
936480
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
936480
936480
# Don't ship the tests
936480
#rm -r $RPM_BUILD_ROOT%{python_sitelib}/tests
936480
936480
mkdir -p $RPM_BUILD_ROOT/var/lib/cloud
936480
936480
# /run/cloud-init needs a tmpfiles.d entry
936480
mkdir -p $RPM_BUILD_ROOT/run/cloud-init
936480
mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir}
936480
cp -p rhel/cloud-init-tmpfiles.conf $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}.conf
936480
936480
# We supply our own config file since our software differs from Ubuntu's.
936480
cp -p rhel/cloud.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/cloud/cloud.cfg
936480
936480
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d
936480
cp -p tools/21-cloudinit.conf $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
936480
936480
# Make installed NetworkManager hook name less generic
936480
mv $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/hook-network-manager \
936480
   $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/cloud-init-azure-hook
936480
936480
# Install our own systemd units (rhbz#1440831)
936480
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
936480
cp rhel/systemd/* $RPM_BUILD_ROOT%{_unitdir}/
936480
936480
[ ! -d $RPM_BUILD_ROOT/usr/lib/systemd/system-generators ] && mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system-generators
936480
cp -p systemd/cloud-init-generator $RPM_BUILD_ROOT/usr/lib/systemd/system-generators
936480
936480
[ ! -d $RPM_BUILD_ROOT/usr/lib/%{name} ] && mkdir -p $RPM_BUILD_ROOT/usr/lib/%{name}
936480
cp -p tools/ds-identify $RPM_BUILD_ROOT/usr/lib/%{name}/ds-identify
936480
936480
936480
%clean
936480
rm -rf $RPM_BUILD_ROOT
936480
936480
936480
%post
936480
if [ $1 -eq 1 ] ; then
936480
    # Initial installation
936480
    # Enabled by default per "runs once then goes away" exception
936480
    /bin/systemctl enable cloud-config.service     >/dev/null 2>&1 || :
936480
    /bin/systemctl enable cloud-final.service      >/dev/null 2>&1 || :
936480
    /bin/systemctl enable cloud-init.service       >/dev/null 2>&1 || :
936480
    /bin/systemctl enable cloud-init-local.service >/dev/null 2>&1 || :
936480
    /bin/systemctl enable cloud-init.target        >/dev/null 2>&1 || :
936480
elif [ $1 -eq 2 ]; then
936480
    # Upgrade. If the upgrade is from a version older than 0.7.9-8,
936480
    # there will be stale systemd config
936480
    /bin/systemctl is-enabled cloud-config.service >/dev/null 2>&1 &&
936480
      /bin/systemctl reenable cloud-config.service >/dev/null 2>&1 || :
936480
936480
    /bin/systemctl is-enabled cloud-final.service >/dev/null 2>&1 &&
936480
      /bin/systemctl reenable cloud-final.service >/dev/null 2>&1 || :
936480
936480
    /bin/systemctl is-enabled cloud-init.service >/dev/null 2>&1 &&
936480
      /bin/systemctl reenable cloud-init.service >/dev/null 2>&1 || :
936480
936480
    /bin/systemctl is-enabled cloud-init-local.service >/dev/null 2>&1 &&
936480
      /bin/systemctl reenable cloud-init-local.service >/dev/null 2>&1 || :
936480
936480
    /bin/systemctl is-enabled cloud-init.target >/dev/null 2>&1 &&
936480
      /bin/systemctl reenable cloud-init.target >/dev/null 2>&1 || :
936480
fi
936480
936480
%preun
936480
if [ $1 -eq 0 ] ; then
936480
    # Package removal, not upgrade
936480
    /bin/systemctl --no-reload disable cloud-config.service >/dev/null 2>&1 || :
936480
    /bin/systemctl --no-reload disable cloud-final.service  >/dev/null 2>&1 || :
936480
    /bin/systemctl --no-reload disable cloud-init.service   >/dev/null 2>&1 || :
936480
    /bin/systemctl --no-reload disable cloud-init-local.service >/dev/null 2>&1 || :
936480
    /bin/systemctl --no-reload disable cloud-init.target     >/dev/null 2>&1 || :
936480
    # One-shot services -> no need to stop
936480
fi
936480
936480
%postun
936480
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
936480
# One-shot services -> no need to restart
936480
936480
936480
%files
936480
%license LICENSE
936480
%doc ChangeLog rhel/README.rhel
936480
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
936480
%dir               %{_sysconfdir}/cloud/cloud.cfg.d
936480
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
936480
%doc               %{_sysconfdir}/cloud/cloud.cfg.d/README
936480
%dir               %{_sysconfdir}/cloud/templates
936480
%config(noreplace) %{_sysconfdir}/cloud/templates/*
936480
%{_unitdir}/cloud-config.service
936480
%{_unitdir}/cloud-config.target
936480
%{_unitdir}/cloud-final.service
936480
%{_unitdir}/cloud-init-local.service
936480
%{_unitdir}/cloud-init.service
936480
%{_unitdir}/cloud-init.target
936480
%{_tmpfilesdir}/%{name}.conf
936480
%{python_sitelib}/*
936480
%{_libexecdir}/%{name}
936480
%{_bindir}/cloud-init*
936480
%doc %{_datadir}/doc/%{name}
936480
%dir /run/cloud-init
936480
%dir /var/lib/cloud
936480
/etc/NetworkManager/dispatcher.d/cloud-init-azure-hook
936480
%{_udevrulesdir}/66-azure-ephemeral.rules
936480
%{_sysconfdir}/bash_completion.d/cloud-init
936480
%{_bindir}/cloud-id
936480
/usr/lib/%{name}/ds-identify
936480
/usr/lib/systemd/system-generators/cloud-init-generator
936480
936480
936480
%dir %{_sysconfdir}/rsyslog.d
936480
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
936480
936480
%changelog
936480
* Tue Sep 10 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.5-5.el7
936480
- ci-Fix-for-network-configuration-not-persisting-after-r.patch [bz#1593010]
936480
- Resolves: bz#1593010
936480
  ([cloud-init][RHVM]cloud-init network configuration does not persist reboot [RHEL 7.8])
936480
936480
* Tue Aug 20 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.5-4.el7
936480
- ci-Azure-Return-static-fallback-address-as-if-failed-to.patch [bz#1726701]
936480
- Resolves: bz#1726701
936480
  ([Azure] [RHEL 7.8] Cloud-init fixes to support fast provisioning for Azure)
936480
936480
* Tue May 28 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.5-3.el7
936480
- ci-Revert-azure-ensure-that-networkmanager-hook-script-.patch [bz#1707725]
936480
- Resolves: bz#1707725
936480
  ([WALA][cloud] cloud-init dhclient-hook script has some unexpected side-effects on Azure)
936480
936480
* Fri May 17 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.5-2.el7
936480
- ci-Azure-Ensure-platform-random_seed-is-always-serializ.patch [bz#1687565]
936480
- ci-DatasourceAzure-add-additional-logging-for-azure-dat.patch [bz#1687565]
936480
- ci-Azure-Changes-to-the-Hyper-V-KVP-Reporter.patch [bz#1687565]
936480
- ci-DataSourceAzure-Adjust-timeout-for-polling-IMDS.patch [bz#1687565]
936480
- ci-cc_mounts-check-if-mount-a-on-no-change-fstab-path.patch [bz#1687565]
936480
- Resolves: bz#1687565
936480
  (cloud-init 18.5 rebase for fast provisioning on Azure [RHEL 7])
936480
936480
* Thu Mar 28 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.5-1.el7
936480
- Rebase to 18.5 [bz#1687565]
936480
- Resolves: bz#1687565
936480
  (cloud-init 18.5 rebase for fast provisioning on Azure [RHEL 7])
936480
936480
* Mon Mar 25 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.2-5.el7
936480
- ci-include-NOZEROCONF-yes-in-etc-sysconfig-network.patch [bz#1653131]
936480
- Resolves: bz#1653131
936480
  (cloud-init remove 'NOZEROCONF=yes' from /etc/sysconfig/network)
936480
936480
* Tue Mar 19 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.2-4.el7
936480
- ci-azure-Filter-list-of-ssh-keys-pulled-from-fabric.patch [bz#1684040]
936480
- Resolves: bz#1684040
936480
  (CVE-2019-0816 cloud-init: extra ssh keys added to authorized_keys [rhel-7.7])
936480
936480
* Tue Mar 05 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.2-3.el7
936480
- ci-cloud-init-per-don-t-use-dashes-in-sem-names.patch [bz#1664876]
936480
- ci-Enable-cloud-init-by-default-on-vmware.patch [bz#1623281]
936480
- Resolves: bz#1623281
936480
  ([ESXi][RHEL7.6]Enable cloud-init by default on VMware)
936480
- Resolves: bz#1664876
936480
  (cloud-init Storage-Management Functionality Is Erasing Filesystems)
936480
936480
* Thu Jan 31 2019 Miroslav Rezanina <mrezanin@redhat.com> - 18.2-2.el7
936480
- ci-net-Wait-for-dhclient-to-daemonize-before-reading-le.patch [bz#1632967]
936480
- Resolves: bz#1632967
936480
  ([Azure] cloud-init dhcp.py dhcp_discovery() race with dhclient with preprovisioned VM in Azure)
936480
936480
* Thu Jun 21 2018 Miroslav Rezanina <mrezanin@redhat.com>
936480
- Rebase to 18.2
936480
  Resolves: rhbz#1525267
936480
936480
* Tue Feb 13 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-24
936480
- Set DHCP_HOSTNAME on Azure to allow for the hostname to be
936480
  published correctly when bouncing the network.
936480
  Resolves: rhbz#1434109
936480
936480
* Mon Jan 15 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-23
936480
- Fix a bug tha caused cloud-init to fail as a result of trying
936480
  to rename bonds.
936480
  Resolves: rhbz#1512247
936480
936480
* Mon Jan 15 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-22
936480
- Apply patch from -21
936480
  Resolves: rhbz#1489270
936480
936480
* Mon Jan 15 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-21
936480
- sysconfig: Fix a potential traceback introduced in the
936480
  0.7.9-17 build
936480
  Resolves: rhbz#1489270
936480
936480
* Sun Dec 17 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-20
936480
- sysconfig: Correct rendering for dhcp on ipv6
936480
  Resolves: rhbz#1519271
936480
936480
* Thu Nov 30 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-19
936480
- sysconfig: Fix rendering of default gateway for ipv6
936480
  Resolves: rhbz#1492726
936480
936480
* Fri Nov 24 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-18
936480
- Start the cloud-init init local service after the dbus socket is created
936480
  so that the hostnamectl command works.
936480
  Resolves: rhbz#1450521
936480
936480
* Tue Nov 21 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-17
936480
- Correctly render DNS and DOMAIN for sysconfig
936480
  Resolves: rhbz#1489270
936480
936480
* Mon Nov 20 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-16
936480
- Disable NetworkManager management of resolv.conf if nameservers
936480
  are specified by configuration.
936480
  Resolves: rhbz#1454491
936480
936480
* Mon Nov 13 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-15
936480
- Fix a null reference error in the rh_subscription module
936480
  Resolves: rhbz#1498974
936480
936480
* Mon Nov 13 2017 Ryan McCabe <rmccabe@redhat.com> 0-7.9-14
936480
- Include gateway if it's included in subnet configration
936480
  Resolves: rhbz#1492726
936480
936480
* Sun Nov 12 2017 Ryan McCabe <rmccabe@redhat.com> 0-7.9-13
936480
- Do proper cleanup of systemd units when upgrading from versions
936480
  0.7.9-3 through 0.7.9-8.
936480
  Resolves: rhbz#1465730
936480
936480
* Thu Nov 09 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-12
936480
- Prevent Azure NM and dhclient hooks from running when cloud-init is
936480
  disabled (rhbz#1474226)
936480
936480
* Tue Oct 31 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-11
936480
- Fix rendering of multiple static IPs per interface file
936480
  Resolves: rhbz#bz1497954
936480
936480
* Tue Sep 26 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-10
936480
- AliCloud: Add support for the Alibaba Cloud datasource (rhbz#1482547)
936480
936480
* Thu Jun 22 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-9
936480
- RHEL/CentOS: Fix default routes for IPv4/IPv6 configuration. (rhbz#1438082)
936480
- azure: ensure that networkmanager hook script runs (rhbz#1440831 rhbz#1460206)
936480
- Fix ipv6 subnet detection (rhbz#1438082)
936480
936480
* Tue May 23 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-8
936480
- Update patches
936480
936480
* Mon May 22 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-7
936480
- Add missing sysconfig unit test data (rhbz#1438082)
936480
- Fix dual stack IPv4/IPv6 configuration for RHEL (rhbz#1438082)
936480
- sysconfig: Raise ValueError when multiple default gateways are present. (rhbz#1438082)
936480
- Bounce network interface for Azure when using the built-in path. (rhbz#1434109)
936480
- Do not write NM_CONTROLLED=no in generated interface config files (rhbz#1385172)
936480
936480
* Wed May 10 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-6
936480
- add power-state-change module to cloud_final_modules (rhbz#1252477)
936480
- remove 'tee' command from logging configuration (rhbz#1424612)
936480
- limit permissions on def_log_file (rhbz#1424612)
936480
- Bounce network interface for Azure when using the built-in path. (rhbz#1434109)
936480
- OpenStack: add 'dvs' to the list of physical link types. (rhbz#1442783)
936480
936480
* Wed May 10 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-5
936480
- systemd: replace generator with unit conditionals (rhbz#1440831)
936480
936480
* Thu Apr 13 2017 Charalampos Stratakis <cstratak@redhat.com> 0.7.9-4
936480
- Import to RHEL 7
936480
Resolves: rhbz#1427280
936480
936480
* Tue Mar 07 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-3
936480
- fixes for network config generation
936480
- avoid dependency cycle at boot (rhbz#1420946)
936480
936480
* Tue Jan 17 2017 Lars Kellogg-Stedman <lars@redhat.com> 0.7.9-2
936480
- use timeout from datasource config in openstack get_data (rhbz#1408589)
936480
936480
* Thu Dec 01 2016 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.9-1
936480
- Rebased on upstream 0.7.9.
936480
- Remove dependency on run-parts
936480
936480
* Wed Jan 06 2016 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-8
936480
- make rh_subscription plugin do nothing in the absence of a valid
936480
  configuration [RH:1295953]
936480
- move rh_subscription module to cloud_config stage
936480
936480
* Wed Jan 06 2016 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-7
936480
- correct permissions on /etc/ssh/sshd_config [RH:1296191]
936480
936480
* Thu Sep 03 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-6
936480
- rebuild for ppc64le
936480
936480
* Tue Jul 07 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-5
936480
- bump revision for new build
936480
936480
* Tue Jul 07 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-4
936480
- ensure rh_subscription plugin is enabled by default
936480
936480
* Wed Apr 29 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-3
936480
- added dependency on python-jinja2 [RH:1215913]
936480
- added rhn_subscription plugin [RH:1227393]
936480
- require pyserial to support smartos data source [RH:1226187]
936480
936480
* Fri Jan 16 2015 Lars Kellogg-Stedman <lars@redhat.com> - 0.7.6-2
936480
- Rebased RHEL version to Fedora rawhide
936480
- Backported fix for https://bugs.launchpad.net/cloud-init/+bug/1246485
936480
- Backported fix for https://bugs.launchpad.net/cloud-init/+bug/1411829
936480
936480
* Fri Nov 14 2014 Colin Walters <walters@redhat.com> - 0.7.6-1
936480
- New upstream version [RH:974327]
936480
- Drop python-cheetah dependency (same as above bug)