sailesh1993 / rpms / cloud-init

Forked from rpms/cloud-init a year ago
Clone
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
c60dcd
Version:        18.2
c6626f
Release:        1%{?dist}.1.0.1
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
c60dcd
Source1:        cloud-init-tmpfiles.conf
c60dcd
c60dcd
Patch0001: 0001-Add-initial-redhat-setup.patch
c60dcd
Patch0002: 0002-Do-not-write-NM_CONTROLLED-no-in-generated-interface.patch
c60dcd
Patch0003: 0003-limit-permissions-on-def_log_file.patch
c60dcd
Patch0004: 0004-remove-tee-command-from-logging-configuration.patch
c60dcd
Patch0005: 0005-add-power-state-change-module-to-cloud_final_modules.patch
c60dcd
Patch0006: 0006-azure-ensure-that-networkmanager-hook-script-runs.patch
c60dcd
Patch0007: 0007-sysconfig-Don-t-write-BOOTPROTO-dhcp-for-ipv6-dhcp.patch
c60dcd
Patch0008: 0008-DataSourceAzure.py-use-hostnamectl-to-set-hostname.patch
c60dcd
Patch0009: 0009-sysconfig-Don-t-disable-IPV6_AUTOCONF.patch
ca58b3
# For bz#1633282 - [Azure] cloud-init fails to mount /dev/sdb1 after stop(deallocate)&&start VM
ca58b3
Patch10: ci-Adding-systemd-mount-options-to-wait-for-cloud-init.patch
ca58b3
# For bz#1633282 - [Azure] cloud-init fails to mount /dev/sdb1 after stop(deallocate)&&start VM
ca58b3
Patch11: ci-Azure-Ignore-NTFS-mount-errors-when-checking-ephemer.patch
ca58b3
# For bz#1633282 - [Azure] cloud-init fails to mount /dev/sdb1 after stop(deallocate)&&start VM
ca58b3
Patch12: ci-azure-Add-reported-ready-marker-file.patch
ca58b3
# For bz#1633282 - [Azure] cloud-init fails to mount /dev/sdb1 after stop(deallocate)&&start VM
ca58b3
Patch13: ci-Adding-disk_setup-to-rhel-cloud.cfg.patch
a4dfde
1302e9
Patch9999: cloud-init-centos-user.patch 
1302e9
c6626f
# Keep old properties in /etc/sysconfig/network
c6626f
# https://bugzilla.redhat.com/show_bug.cgi?id=1558641
c6626f
Patch10000: cloud-init-17.1-no-override-default-network.patch
c6626f
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
c60dcd
BuildRequires:  python-requests
ef3f20
BuildRequires:  python-setuptools
c60dcd
BuildRequires:  python-six
c60dcd
BuildRequires:  python-yaml
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
c60dcd
Requires:       python-six
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
c60dcd
# # create new files.  rpm 4.11.3 and later has -S git_am, but
c60dcd
# # el7 only has 4.11.1.
ef3f20
%autosetup -p1 -n %{name}-%{version} -S git
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
c60dcd
#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 || :
1064ba
elif [ $1 -eq 2 ]; then
1064ba
    # Upgrade. If the upgrade is from a version older than 0.7.9-8,
1064ba
    # there will be stale systemd config
1064ba
    /bin/systemctl is-enabled cloud-config.service >/dev/null 2>&1 &&
1064ba
      /bin/systemctl reenable cloud-config.service >/dev/null 2>&1 || :
1064ba
1064ba
    /bin/systemctl is-enabled cloud-final.service >/dev/null 2>&1 &&
1064ba
      /bin/systemctl reenable cloud-final.service >/dev/null 2>&1 || :
1064ba
1064ba
    /bin/systemctl is-enabled cloud-init.service >/dev/null 2>&1 &&
1064ba
      /bin/systemctl reenable cloud-init.service >/dev/null 2>&1 || :
1064ba
1064ba
    /bin/systemctl is-enabled cloud-init-local.service >/dev/null 2>&1 &&
1064ba
      /bin/systemctl reenable 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
c6626f
* Fri Dec 14 2018 Patrick Uiterwijk <puiterwijk@redhat.com> - 18.2-1.el7_6.1.0.1
c6626f
- Add patch to retain old values of /etc/sysconfig/network
c6626f
ca58b3
* Thu Sep 27 2018 Miroslav Rezanina <mrezanin@redhat.com> - 18.2-1.el7_6.1
ca58b3
- ci-Adding-systemd-mount-options-to-wait-for-cloud-init.patch [bz#1633282]
ca58b3
- ci-Azure-Ignore-NTFS-mount-errors-when-checking-ephemer.patch [bz#1633282]
ca58b3
- ci-azure-Add-reported-ready-marker-file.patch [bz#1633282]
ca58b3
- ci-Adding-disk_setup-to-rhel-cloud.cfg.patch [bz#1633282]
ca58b3
- Resolves: bz#1633282
ca58b3
  ([Azure] cloud-init fails to mount /dev/sdb1 after stop(deallocate)&&start VM)
ca58b3
c60dcd
* Thu Jun 21 2018 Miroslav Rezanina <mrezanin@redhat.com>
c60dcd
- Rebase to 18.2
c60dcd
  Resolves: rhbz#1525267
140f72
1064ba
* Tue Feb 13 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-24
1064ba
- Set DHCP_HOSTNAME on Azure to allow for the hostname to be
1064ba
  published correctly when bouncing the network.
1064ba
  Resolves: rhbz#1434109
1064ba
1064ba
* Mon Jan 15 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-23
1064ba
- Fix a bug tha caused cloud-init to fail as a result of trying
1064ba
  to rename bonds.
1064ba
  Resolves: rhbz#1512247
1064ba
1064ba
* Mon Jan 15 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-22
1064ba
- Apply patch from -21
1064ba
  Resolves: rhbz#1489270
1064ba
1064ba
* Mon Jan 15 2018 Ryan McCabe <rmccabe@redhat.com> 0.7.9-21
1064ba
- sysconfig: Fix a potential traceback introduced in the
1064ba
  0.7.9-17 build
1064ba
  Resolves: rhbz#1489270
1064ba
1064ba
* Sun Dec 17 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-20
1064ba
- sysconfig: Correct rendering for dhcp on ipv6
1064ba
  Resolves: rhbz#1519271
5a2e6e
1064ba
* Thu Nov 30 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-19
5a2e6e
- sysconfig: Fix rendering of default gateway for ipv6
1064ba
  Resolves: rhbz#1492726
5a2e6e
1064ba
* Fri Nov 24 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-18
1064ba
- Start the cloud-init init local service after the dbus socket is created
1064ba
  so that the hostnamectl command works.
1064ba
  Resolves: rhbz#1450521
5a2e6e
1064ba
* Tue Nov 21 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-17
1064ba
- Correctly render DNS and DOMAIN for sysconfig
1064ba
  Resolves: rhbz#1489270
1064ba
1064ba
* Mon Nov 20 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-16
5a2e6e
- Disable NetworkManager management of resolv.conf if nameservers
5a2e6e
  are specified by configuration.
1064ba
  Resolves: rhbz#1454491
1064ba
1064ba
* Mon Nov 13 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-15
1064ba
- Fix a null reference error in the rh_subscription module
1064ba
  Resolves: rhbz#1498974
7ecf9d
1064ba
* Mon Nov 13 2017 Ryan McCabe <rmccabe@redhat.com> 0-7.9-14
1064ba
- Include gateway if it's included in subnet configration
1064ba
  Resolves: rhbz#1492726
1064ba
1064ba
* Sun Nov 12 2017 Ryan McCabe <rmccabe@redhat.com> 0-7.9-13
1064ba
- Do proper cleanup of systemd units when upgrading from versions
1064ba
  0.7.9-3 through 0.7.9-8.
1064ba
  Resolves: rhbz#1465730
1064ba
1064ba
* Thu Nov 09 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-12
48a629
- Prevent Azure NM and dhclient hooks from running when cloud-init is
1064ba
  disabled (rhbz#1474226)
1064ba
1064ba
* Tue Oct 31 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-11
1064ba
- Fix rendering of multiple static IPs per interface file
1064ba
  Resolves: rhbz#bz1497954
48a629
1064ba
* Tue Sep 26 2017 Ryan McCabe <rmccabe@redhat.com> 0.7.9-10
1064ba
- AliCloud: Add support for the Alibaba Cloud datasource (rhbz#1482547)
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)