|
|
08c715 |
From 074cb9b011623849cfa95c1d7cc813bb28f03ff0 Mon Sep 17 00:00:00 2001
|
|
|
297660 |
From: Eduardo Otubo <otubo@redhat.com>
|
|
|
08c715 |
Date: Fri, 7 May 2021 13:36:03 +0200
|
|
|
222d62 |
Subject: Add initial redhat setup
|
|
|
222d62 |
|
|
|
08c715 |
Merged patches (21.1):
|
|
|
08c715 |
- 915d30ad Change gating file to correct rhel version
|
|
|
08c715 |
- 311f318d Removing net-tools dependency
|
|
|
08c715 |
- 74731806 Adding man pages to Red Hat spec file
|
|
|
08c715 |
- 758d333d Removing blocking test from yaml configuration file
|
|
|
08c715 |
- c7e7c59c Changing permission of cloud-init-generator to 755
|
|
|
08c715 |
- 8b85abbb Installing man pages in the correct place with correct permissions
|
|
|
08c715 |
- c6808d8d Fix unit failure of cloud-final.service if NetworkManager was not present.
|
|
|
08c715 |
- 11866ef6 Report full specific version with "cloud-init --version"
|
|
|
08c715 |
|
|
|
0a07cd |
Rebase notes (18.5):
|
|
|
0a07cd |
- added bash_completition file
|
|
|
0a07cd |
- added cloud-id file
|
|
|
0a07cd |
|
|
|
297660 |
Merged patches (20.3):
|
|
|
297660 |
- 01900d0 changing ds-identify patch from /usr/lib to /usr/libexec
|
|
|
297660 |
- 7f47ca3 Render the generator from template instead of cp
|
|
|
297660 |
|
|
|
9dab26 |
Merged patches (19.4):
|
|
|
9dab26 |
- 4ab5a61 Fix for network configuration not persisting after reboot
|
|
|
9dab26 |
- 84cf125 Removing cloud-user from wheel
|
|
|
9dab26 |
- 31290ab Adding gating tests for Azure, ESXi and AWS
|
|
|
9dab26 |
|
|
|
0a07cd |
Merged patches (18.5):
|
|
|
0a07cd |
- 2d6b469 add power-state-change module to cloud_final_modules
|
|
|
0a07cd |
- 764159f Adding systemd mount options to wait for cloud-init
|
|
|
0a07cd |
- da4d99e Adding disk_setup to rhel/cloud.cfg
|
|
|
0a07cd |
- f5c6832 Enable cloud-init by default on vmware
|
|
|
297660 |
|
|
|
297660 |
Conflicts:
|
|
|
297660 |
cloudinit/config/cc_chef.py:
|
|
|
297660 |
- Updated header documentation text
|
|
|
297660 |
- Replacing double quotes by simple quotes
|
|
|
297660 |
|
|
|
297660 |
setup.py:
|
|
|
297660 |
- Adding missing cmdclass info
|
|
|
297660 |
|
|
|
297660 |
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
|
|
|
222d62 |
---
|
|
|
9dab26 |
.gitignore | 1 +
|
|
|
08c715 |
cloudinit/config/cc_chef.py | 67 +++-
|
|
|
222d62 |
cloudinit/settings.py | 7 +-
|
|
|
222d62 |
redhat/.gitignore | 1 +
|
|
|
08c715 |
redhat/Makefile | 71 ++++
|
|
|
08c715 |
redhat/Makefile.common | 37 ++
|
|
|
222d62 |
redhat/cloud-init-tmpfiles.conf | 1 +
|
|
|
08c715 |
redhat/cloud-init.spec.template | 530 ++++++++++++++++++++++++++
|
|
|
08c715 |
redhat/gating.yaml | 8 +
|
|
|
222d62 |
redhat/rpmbuild/BUILD/.gitignore | 3 +
|
|
|
222d62 |
redhat/rpmbuild/RPMS/.gitignore | 3 +
|
|
|
222d62 |
redhat/rpmbuild/SOURCES/.gitignore | 3 +
|
|
|
222d62 |
redhat/rpmbuild/SPECS/.gitignore | 3 +
|
|
|
222d62 |
redhat/rpmbuild/SRPMS/.gitignore | 3 +
|
|
|
297660 |
redhat/scripts/frh.py | 27 ++
|
|
|
08c715 |
redhat/scripts/git-backport-diff | 327 ++++++++++++++++
|
|
|
08c715 |
redhat/scripts/git-compile-check | 215 +++++++++++
|
|
|
08c715 |
redhat/scripts/process-patches.sh | 77 ++++
|
|
|
222d62 |
redhat/scripts/tarball_checksum.sh | 3 +
|
|
|
222d62 |
rhel/README.rhel | 5 +
|
|
|
222d62 |
rhel/cloud-init-tmpfiles.conf | 1 +
|
|
|
08c715 |
rhel/cloud.cfg | 69 ++++
|
|
|
08c715 |
rhel/systemd/cloud-config.service | 18 +
|
|
|
0a07cd |
rhel/systemd/cloud-config.target | 11 +
|
|
|
08c715 |
rhel/systemd/cloud-final.service | 24 ++
|
|
|
297660 |
rhel/systemd/cloud-init-local.service | 31 ++
|
|
|
0a07cd |
rhel/systemd/cloud-init.service | 25 ++
|
|
|
9dab26 |
rhel/systemd/cloud-init.target | 7 +
|
|
|
297660 |
setup.py | 23 +-
|
|
|
297660 |
tools/read-version | 28 +-
|
|
|
08c715 |
30 files changed, 1579 insertions(+), 50 deletions(-)
|
|
|
222d62 |
create mode 100644 redhat/.gitignore
|
|
|
222d62 |
create mode 100644 redhat/Makefile
|
|
|
222d62 |
create mode 100644 redhat/Makefile.common
|
|
|
222d62 |
create mode 100644 redhat/cloud-init-tmpfiles.conf
|
|
|
222d62 |
create mode 100644 redhat/cloud-init.spec.template
|
|
|
9dab26 |
create mode 100644 redhat/gating.yaml
|
|
|
222d62 |
create mode 100644 redhat/rpmbuild/BUILD/.gitignore
|
|
|
222d62 |
create mode 100644 redhat/rpmbuild/RPMS/.gitignore
|
|
|
222d62 |
create mode 100644 redhat/rpmbuild/SOURCES/.gitignore
|
|
|
222d62 |
create mode 100644 redhat/rpmbuild/SPECS/.gitignore
|
|
|
222d62 |
create mode 100644 redhat/rpmbuild/SRPMS/.gitignore
|
|
|
222d62 |
create mode 100755 redhat/scripts/frh.py
|
|
|
222d62 |
create mode 100755 redhat/scripts/git-backport-diff
|
|
|
222d62 |
create mode 100755 redhat/scripts/git-compile-check
|
|
|
222d62 |
create mode 100755 redhat/scripts/process-patches.sh
|
|
|
222d62 |
create mode 100755 redhat/scripts/tarball_checksum.sh
|
|
|
222d62 |
create mode 100644 rhel/README.rhel
|
|
|
222d62 |
create mode 100644 rhel/cloud-init-tmpfiles.conf
|
|
|
222d62 |
create mode 100644 rhel/cloud.cfg
|
|
|
222d62 |
create mode 100644 rhel/systemd/cloud-config.service
|
|
|
222d62 |
create mode 100644 rhel/systemd/cloud-config.target
|
|
|
222d62 |
create mode 100644 rhel/systemd/cloud-final.service
|
|
|
222d62 |
create mode 100644 rhel/systemd/cloud-init-local.service
|
|
|
222d62 |
create mode 100644 rhel/systemd/cloud-init.service
|
|
|
9dab26 |
create mode 100644 rhel/systemd/cloud-init.target
|
|
|
222d62 |
|
|
|
222d62 |
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
|
|
|
08c715 |
index aaf71366..97ef649a 100644
|
|
|
222d62 |
--- a/cloudinit/config/cc_chef.py
|
|
|
222d62 |
+++ b/cloudinit/config/cc_chef.py
|
|
|
297660 |
@@ -6,7 +6,70 @@
|
|
|
297660 |
#
|
|
|
297660 |
# This file is part of cloud-init. See LICENSE file for license information.
|
|
|
222d62 |
|
|
|
297660 |
-"""Chef: module that configures, starts and installs chef."""
|
|
|
297660 |
+"""
|
|
|
297660 |
+Chef
|
|
|
297660 |
+----
|
|
|
297660 |
+**Summary:** module that configures, starts and installs chef.
|
|
|
297660 |
+
|
|
|
297660 |
+This module enables chef to be installed (from packages or
|
|
|
297660 |
+from gems, or from omnibus). Before this occurs chef configurations are
|
|
|
297660 |
+written to disk (validation.pem, client.pem, firstboot.json, client.rb),
|
|
|
297660 |
+and needed chef folders/directories are created (/etc/chef and /var/log/chef
|
|
|
297660 |
+and so-on). Then once installing proceeds correctly if configured chef will
|
|
|
297660 |
+be started (in daemon mode or in non-daemon mode) and then once that has
|
|
|
297660 |
+finished (if ran in non-daemon mode this will be when chef finishes
|
|
|
297660 |
+converging, if ran in daemon mode then no further actions are possible since
|
|
|
297660 |
+chef will have forked into its own process) then a post run function can
|
|
|
297660 |
+run that can do finishing activities (such as removing the validation pem
|
|
|
297660 |
+file).
|
|
|
297660 |
+
|
|
|
297660 |
+**Internal name:** ``cc_chef``
|
|
|
297660 |
+
|
|
|
297660 |
+**Module frequency:** per always
|
|
|
297660 |
+
|
|
|
297660 |
+**Supported distros:** all
|
|
|
297660 |
+
|
|
|
297660 |
+**Config keys**::
|
|
|
297660 |
+
|
|
|
297660 |
+ chef:
|
|
|
297660 |
+ directories: (defaulting to /etc/chef, /var/log/chef, /var/lib/chef,
|
|
|
222d62 |
+ /var/cache/chef, /var/backups/chef, /run/chef)
|
|
|
297660 |
+ validation_cert: (optional string to be written to file validation_key)
|
|
|
297660 |
+ special value 'system' means set use existing file
|
|
|
297660 |
+ validation_key: (optional the path for validation_cert. default
|
|
|
297660 |
+ /etc/chef/validation.pem)
|
|
|
297660 |
+ firstboot_path: (path to write run_list and initial_attributes keys that
|
|
|
297660 |
+ should also be present in this configuration, defaults
|
|
|
297660 |
+ to /etc/chef/firstboot.json)
|
|
|
297660 |
+ exec: boolean to run or not run chef (defaults to false, unless
|
|
|
297660 |
+ a gem installed is requested
|
|
|
297660 |
+ where this will then default
|
|
|
297660 |
+ to true)
|
|
|
297660 |
+
|
|
|
297660 |
+ chef.rb template keys (if falsey, then will be skipped and not
|
|
|
297660 |
+ written to /etc/chef/client.rb)
|
|
|
297660 |
+
|
|
|
297660 |
+ chef:
|
|
|
297660 |
+ client_key:
|
|
|
297660 |
+ encrypted_data_bag_secret:
|
|
|
297660 |
+ environment:
|
|
|
297660 |
+ file_backup_path:
|
|
|
297660 |
+ file_cache_path:
|
|
|
297660 |
+ json_attribs:
|
|
|
297660 |
+ log_level:
|
|
|
297660 |
+ log_location:
|
|
|
297660 |
+ node_name:
|
|
|
297660 |
+ omnibus_url:
|
|
|
297660 |
+ omnibus_url_retries:
|
|
|
297660 |
+ omnibus_version:
|
|
|
297660 |
+ pid_file:
|
|
|
297660 |
+ server_url:
|
|
|
297660 |
+ show_time:
|
|
|
297660 |
+ ssl_verify_mode:
|
|
|
297660 |
+ validation_cert:
|
|
|
297660 |
+ validation_key:
|
|
|
297660 |
+ validation_name:
|
|
|
297660 |
+"""
|
|
|
297660 |
|
|
|
297660 |
import itertools
|
|
|
297660 |
import json
|
|
|
297660 |
@@ -31,7 +94,7 @@ CHEF_DIRS = tuple([
|
|
|
222d62 |
'/var/lib/chef',
|
|
|
222d62 |
'/var/cache/chef',
|
|
|
222d62 |
'/var/backups/chef',
|
|
|
222d62 |
- '/var/run/chef',
|
|
|
222d62 |
+ '/run/chef',
|
|
|
222d62 |
])
|
|
|
222d62 |
REQUIRED_CHEF_DIRS = tuple([
|
|
|
222d62 |
'/etc/chef',
|
|
|
222d62 |
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
|
|
|
08c715 |
index 91e1bfe7..e690c0fd 100644
|
|
|
222d62 |
--- a/cloudinit/settings.py
|
|
|
222d62 |
+++ b/cloudinit/settings.py
|
|
|
08c715 |
@@ -47,13 +47,16 @@ CFG_BUILTIN = {
|
|
|
222d62 |
],
|
|
|
222d62 |
'def_log_file': '/var/log/cloud-init.log',
|
|
|
222d62 |
'log_cfgs': [],
|
|
|
0a07cd |
- 'syslog_fix_perms': ['syslog:adm', 'root:adm', 'root:wheel', 'root:root'],
|
|
|
222d62 |
+ 'mount_default_fields': [None, None, 'auto', 'defaults,nofail', '0', '2'],
|
|
|
222d62 |
+ 'ssh_deletekeys': False,
|
|
|
222d62 |
+ 'ssh_genkeytypes': [],
|
|
|
222d62 |
+ 'syslog_fix_perms': [],
|
|
|
222d62 |
'system_info': {
|
|
|
222d62 |
'paths': {
|
|
|
222d62 |
'cloud_dir': '/var/lib/cloud',
|
|
|
222d62 |
'templates_dir': '/etc/cloud/templates/',
|
|
|
222d62 |
},
|
|
|
222d62 |
- 'distro': 'ubuntu',
|
|
|
222d62 |
+ 'distro': 'rhel',
|
|
|
222d62 |
'network': {'renderers': None},
|
|
|
222d62 |
},
|
|
|
222d62 |
'vendor_data': {'enabled': True, 'prefix': []},
|
|
|
222d62 |
diff --git a/rhel/README.rhel b/rhel/README.rhel
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..aa29630d
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/README.rhel
|
|
|
222d62 |
@@ -0,0 +1,5 @@
|
|
|
222d62 |
+The following cloud-init modules are currently unsupported on this OS:
|
|
|
222d62 |
+ - apt_update_upgrade ('apt_update', 'apt_upgrade', 'apt_mirror', 'apt_preserve_sources_list', 'apt_old_mirror', 'apt_sources', 'debconf_selections', 'packages' options)
|
|
|
222d62 |
+ - byobu ('byobu_by_default' option)
|
|
|
222d62 |
+ - chef
|
|
|
222d62 |
+ - grub_dpkg
|
|
|
222d62 |
diff --git a/rhel/cloud-init-tmpfiles.conf b/rhel/cloud-init-tmpfiles.conf
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..0c6d2a3b
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/cloud-init-tmpfiles.conf
|
|
|
222d62 |
@@ -0,0 +1 @@
|
|
|
222d62 |
+d /run/cloud-init 0700 root root - -
|
|
|
222d62 |
diff --git a/rhel/cloud.cfg b/rhel/cloud.cfg
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..82e8bf62
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/cloud.cfg
|
|
|
0a07cd |
@@ -0,0 +1,69 @@
|
|
|
222d62 |
+users:
|
|
|
222d62 |
+ - default
|
|
|
222d62 |
+
|
|
|
222d62 |
+disable_root: 1
|
|
|
222d62 |
+ssh_pwauth: 0
|
|
|
222d62 |
+
|
|
|
0a07cd |
+mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service', '0', '2']
|
|
|
222d62 |
+resize_rootfs_tmp: /dev
|
|
|
222d62 |
+ssh_deletekeys: 0
|
|
|
222d62 |
+ssh_genkeytypes: ~
|
|
|
222d62 |
+syslog_fix_perms: ~
|
|
|
0a07cd |
+disable_vmware_customization: false
|
|
|
222d62 |
+
|
|
|
222d62 |
+cloud_init_modules:
|
|
|
0a07cd |
+ - disk_setup
|
|
|
222d62 |
+ - migrator
|
|
|
222d62 |
+ - bootcmd
|
|
|
222d62 |
+ - write-files
|
|
|
222d62 |
+ - growpart
|
|
|
222d62 |
+ - resizefs
|
|
|
222d62 |
+ - set_hostname
|
|
|
222d62 |
+ - update_hostname
|
|
|
222d62 |
+ - update_etc_hosts
|
|
|
222d62 |
+ - rsyslog
|
|
|
222d62 |
+ - users-groups
|
|
|
222d62 |
+ - ssh
|
|
|
222d62 |
+
|
|
|
222d62 |
+cloud_config_modules:
|
|
|
222d62 |
+ - mounts
|
|
|
222d62 |
+ - locale
|
|
|
222d62 |
+ - set-passwords
|
|
|
222d62 |
+ - rh_subscription
|
|
|
222d62 |
+ - yum-add-repo
|
|
|
222d62 |
+ - package-update-upgrade-install
|
|
|
222d62 |
+ - timezone
|
|
|
222d62 |
+ - puppet
|
|
|
222d62 |
+ - chef
|
|
|
222d62 |
+ - salt-minion
|
|
|
222d62 |
+ - mcollective
|
|
|
222d62 |
+ - disable-ec2-metadata
|
|
|
222d62 |
+ - runcmd
|
|
|
222d62 |
+
|
|
|
222d62 |
+cloud_final_modules:
|
|
|
222d62 |
+ - rightscale_userdata
|
|
|
222d62 |
+ - scripts-per-once
|
|
|
222d62 |
+ - scripts-per-boot
|
|
|
222d62 |
+ - scripts-per-instance
|
|
|
222d62 |
+ - scripts-user
|
|
|
222d62 |
+ - ssh-authkey-fingerprints
|
|
|
222d62 |
+ - keys-to-console
|
|
|
222d62 |
+ - phone-home
|
|
|
222d62 |
+ - final-message
|
|
|
0a07cd |
+ - power-state-change
|
|
|
222d62 |
+
|
|
|
222d62 |
+system_info:
|
|
|
222d62 |
+ default_user:
|
|
|
222d62 |
+ name: cloud-user
|
|
|
222d62 |
+ lock_passwd: true
|
|
|
222d62 |
+ gecos: Cloud User
|
|
|
9dab26 |
+ groups: [adm, systemd-journal]
|
|
|
222d62 |
+ sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
|
|
222d62 |
+ shell: /bin/bash
|
|
|
222d62 |
+ distro: rhel
|
|
|
222d62 |
+ paths:
|
|
|
222d62 |
+ cloud_dir: /var/lib/cloud
|
|
|
222d62 |
+ templates_dir: /etc/cloud/templates
|
|
|
222d62 |
+ ssh_svcname: sshd
|
|
|
222d62 |
+
|
|
|
222d62 |
+# vim:syntax=yaml
|
|
|
222d62 |
diff --git a/rhel/systemd/cloud-config.service b/rhel/systemd/cloud-config.service
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..f3dcd4be
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/systemd/cloud-config.service
|
|
|
222d62 |
@@ -0,0 +1,18 @@
|
|
|
222d62 |
+[Unit]
|
|
|
222d62 |
+Description=Apply the settings specified in cloud-config
|
|
|
222d62 |
+After=network-online.target cloud-config.target
|
|
|
222d62 |
+Wants=network-online.target cloud-config.target
|
|
|
222d62 |
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
|
222d62 |
+ConditionKernelCommandLine=!cloud-init=disabled
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Service]
|
|
|
222d62 |
+Type=oneshot
|
|
|
222d62 |
+ExecStart=/usr/bin/cloud-init modules --mode=config
|
|
|
222d62 |
+RemainAfterExit=yes
|
|
|
222d62 |
+TimeoutSec=0
|
|
|
222d62 |
+
|
|
|
222d62 |
+# Output needs to appear in instance console output
|
|
|
222d62 |
+StandardOutput=journal+console
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Install]
|
|
|
9dab26 |
+WantedBy=cloud-init.target
|
|
|
222d62 |
diff --git a/rhel/systemd/cloud-config.target b/rhel/systemd/cloud-config.target
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..ae9b7d02
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/systemd/cloud-config.target
|
|
|
222d62 |
@@ -0,0 +1,11 @@
|
|
|
222d62 |
+# cloud-init normally emits a "cloud-config" upstart event to inform third
|
|
|
222d62 |
+# parties that cloud-config is available, which does us no good when we're
|
|
|
222d62 |
+# using systemd. cloud-config.target serves as this synchronization point
|
|
|
222d62 |
+# instead. Services that would "start on cloud-config" with upstart can
|
|
|
222d62 |
+# instead use "After=cloud-config.target" and "Wants=cloud-config.target"
|
|
|
222d62 |
+# as appropriate.
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Unit]
|
|
|
222d62 |
+Description=Cloud-config availability
|
|
|
222d62 |
+Wants=cloud-init-local.service cloud-init.service
|
|
|
222d62 |
+After=cloud-init-local.service cloud-init.service
|
|
|
222d62 |
diff --git a/rhel/systemd/cloud-final.service b/rhel/systemd/cloud-final.service
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..e281c0cf
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/systemd/cloud-final.service
|
|
|
08c715 |
@@ -0,0 +1,24 @@
|
|
|
222d62 |
+[Unit]
|
|
|
222d62 |
+Description=Execute cloud user/final scripts
|
|
|
222d62 |
+After=network-online.target cloud-config.service rc-local.service
|
|
|
222d62 |
+Wants=network-online.target cloud-config.service
|
|
|
222d62 |
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
|
222d62 |
+ConditionKernelCommandLine=!cloud-init=disabled
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Service]
|
|
|
222d62 |
+Type=oneshot
|
|
|
222d62 |
+ExecStart=/usr/bin/cloud-init modules --mode=final
|
|
|
222d62 |
+RemainAfterExit=yes
|
|
|
222d62 |
+TimeoutSec=0
|
|
|
222d62 |
+KillMode=process
|
|
|
08c715 |
+# Restart NetworkManager if it is present and running.
|
|
|
08c715 |
+ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \
|
|
|
08c715 |
+ out=$(systemctl show --property=SubState $u) || exit; \
|
|
|
08c715 |
+ [ "$out" = "SubState=running" ] || exit 0; \
|
|
|
08c715 |
+ systemctl reload-or-try-restart $u'
|
|
|
222d62 |
+
|
|
|
222d62 |
+# Output needs to appear in instance console output
|
|
|
222d62 |
+StandardOutput=journal+console
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Install]
|
|
|
9dab26 |
+WantedBy=cloud-init.target
|
|
|
222d62 |
diff --git a/rhel/systemd/cloud-init-local.service b/rhel/systemd/cloud-init-local.service
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..8f9f6c9f
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/systemd/cloud-init-local.service
|
|
|
222d62 |
@@ -0,0 +1,31 @@
|
|
|
222d62 |
+[Unit]
|
|
|
222d62 |
+Description=Initial cloud-init job (pre-networking)
|
|
|
222d62 |
+DefaultDependencies=no
|
|
|
222d62 |
+Wants=network-pre.target
|
|
|
222d62 |
+After=systemd-remount-fs.service
|
|
|
222d62 |
+Requires=dbus.socket
|
|
|
222d62 |
+After=dbus.socket
|
|
|
222d62 |
+Before=NetworkManager.service network.service
|
|
|
222d62 |
+Before=network-pre.target
|
|
|
222d62 |
+Before=shutdown.target
|
|
|
222d62 |
+Before=firewalld.target
|
|
|
222d62 |
+Conflicts=shutdown.target
|
|
|
222d62 |
+RequiresMountsFor=/var/lib/cloud
|
|
|
222d62 |
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
|
222d62 |
+ConditionKernelCommandLine=!cloud-init=disabled
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Service]
|
|
|
222d62 |
+Type=oneshot
|
|
|
222d62 |
+ExecStartPre=/bin/mkdir -p /run/cloud-init
|
|
|
222d62 |
+ExecStartPre=/sbin/restorecon /run/cloud-init
|
|
|
222d62 |
+ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
|
|
|
222d62 |
+ExecStart=/usr/bin/cloud-init init --local
|
|
|
222d62 |
+ExecStart=/bin/touch /run/cloud-init/network-config-ready
|
|
|
222d62 |
+RemainAfterExit=yes
|
|
|
222d62 |
+TimeoutSec=0
|
|
|
222d62 |
+
|
|
|
222d62 |
+# Output needs to appear in instance console output
|
|
|
222d62 |
+StandardOutput=journal+console
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Install]
|
|
|
9dab26 |
+WantedBy=cloud-init.target
|
|
|
222d62 |
diff --git a/rhel/systemd/cloud-init.service b/rhel/systemd/cloud-init.service
|
|
|
222d62 |
new file mode 100644
|
|
|
08c715 |
index 00000000..d0023a05
|
|
|
222d62 |
--- /dev/null
|
|
|
222d62 |
+++ b/rhel/systemd/cloud-init.service
|
|
|
222d62 |
@@ -0,0 +1,25 @@
|
|
|
222d62 |
+[Unit]
|
|
|
222d62 |
+Description=Initial cloud-init job (metadata service crawler)
|
|
|
222d62 |
+Wants=cloud-init-local.service
|
|
|
222d62 |
+Wants=sshd-keygen.service
|
|
|
222d62 |
+Wants=sshd.service
|
|
|
222d62 |
+After=cloud-init-local.service
|
|
|
222d62 |
+After=NetworkManager.service network.service
|
|
|
222d62 |
+Before=network-online.target
|
|
|
222d62 |
+Before=sshd-keygen.service
|
|
|
222d62 |
+Before=sshd.service
|
|
|
222d62 |
+Before=systemd-user-sessions.service
|
|
|
222d62 |
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
|
222d62 |
+ConditionKernelCommandLine=!cloud-init=disabled
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Service]
|
|
|
222d62 |
+Type=oneshot
|
|
|
222d62 |
+ExecStart=/usr/bin/cloud-init init
|
|
|
222d62 |
+RemainAfterExit=yes
|
|
|
222d62 |
+TimeoutSec=0
|
|
|
222d62 |
+
|
|
|
222d62 |
+# Output needs to appear in instance console output
|
|
|
222d62 |
+StandardOutput=journal+console
|
|
|
222d62 |
+
|
|
|
222d62 |
+[Install]
|
|
|
9dab26 |
+WantedBy=cloud-init.target
|
|
|
9dab26 |
diff --git a/rhel/systemd/cloud-init.target b/rhel/systemd/cloud-init.target
|
|
|
9dab26 |
new file mode 100644
|
|
|
08c715 |
index 00000000..083c3b6f
|
|
|
9dab26 |
--- /dev/null
|
|
|
9dab26 |
+++ b/rhel/systemd/cloud-init.target
|
|
|
9dab26 |
@@ -0,0 +1,7 @@
|
|
|
9dab26 |
+# cloud-init target is enabled by cloud-init-generator
|
|
|
9dab26 |
+# To disable it you can either:
|
|
|
9dab26 |
+# a.) boot with kernel cmdline of 'cloud-init=disabled'
|
|
|
9dab26 |
+# b.) touch a file /etc/cloud/cloud-init.disabled
|
|
|
9dab26 |
+[Unit]
|
|
|
9dab26 |
+Description=Cloud-init target
|
|
|
9dab26 |
+After=multi-user.target
|
|
|
222d62 |
diff --git a/setup.py b/setup.py
|
|
|
08c715 |
index cbacf48e..d5cd01a4 100755
|
|
|
222d62 |
--- a/setup.py
|
|
|
222d62 |
+++ b/setup.py
|
|
|
297660 |
@@ -125,14 +125,6 @@ INITSYS_FILES = {
|
|
|
222d62 |
'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)],
|
|
|
222d62 |
'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)],
|
|
|
222d62 |
'sysvinit_suse': [f for f in glob('sysvinit/suse/*') if is_f(f)],
|
|
|
222d62 |
- 'systemd': [render_tmpl(f)
|
|
|
222d62 |
- for f in (glob('systemd/*.tmpl') +
|
|
|
222d62 |
- glob('systemd/*.service') +
|
|
|
9dab26 |
- glob('systemd/*.target'))
|
|
|
9dab26 |
- if (is_f(f) and not is_generator(f))],
|
|
|
9dab26 |
- 'systemd.generators': [
|
|
|
9dab26 |
- render_tmpl(f, mode=0o755)
|
|
|
9dab26 |
- for f in glob('systemd/*') if is_f(f) and is_generator(f)],
|
|
|
222d62 |
'upstart': [f for f in glob('upstart/*') if is_f(f)],
|
|
|
222d62 |
}
|
|
|
222d62 |
INITSYS_ROOTS = {
|
|
|
297660 |
@@ -142,9 +134,6 @@ INITSYS_ROOTS = {
|
|
|
222d62 |
'sysvinit_deb': 'etc/init.d',
|
|
|
222d62 |
'sysvinit_openrc': 'etc/init.d',
|
|
|
222d62 |
'sysvinit_suse': 'etc/init.d',
|
|
|
222d62 |
- 'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'),
|
|
|
222d62 |
- 'systemd.generators': pkg_config_read('systemd',
|
|
|
222d62 |
- 'systemdsystemgeneratordir'),
|
|
|
222d62 |
'upstart': 'etc/init/',
|
|
|
222d62 |
}
|
|
|
222d62 |
INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()])
|
|
|
297660 |
@@ -245,14 +234,11 @@ if not in_virtualenv():
|
|
|
9dab26 |
INITSYS_ROOTS[k] = "/" + INITSYS_ROOTS[k]
|
|
|
222d62 |
|
|
|
222d62 |
data_files = [
|
|
|
222d62 |
- (ETC + '/cloud', [render_tmpl("config/cloud.cfg.tmpl")]),
|
|
|
9dab26 |
+ (ETC + '/bash_completion.d', ['bash_completion/cloud-init']),
|
|
|
222d62 |
(ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
|
|
|
222d62 |
(ETC + '/cloud/templates', glob('templates/*')),
|
|
|
222d62 |
- (USR_LIB_EXEC + '/cloud-init', ['tools/ds-identify',
|
|
|
222d62 |
- 'tools/uncloud-init',
|
|
|
222d62 |
+ (USR_LIB_EXEC + '/cloud-init', ['tools/uncloud-init',
|
|
|
222d62 |
'tools/write-ssh-key-fingerprints']),
|
|
|
9dab26 |
- (USR + '/share/bash-completion/completions',
|
|
|
9dab26 |
- ['bash_completion/cloud-init']),
|
|
|
222d62 |
(USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]),
|
|
|
222d62 |
(USR + '/share/doc/cloud-init/examples',
|
|
|
9dab26 |
[f for f in glob('doc/examples/*') if is_f(f)]),
|
|
|
297660 |
@@ -263,8 +249,7 @@ if not platform.system().endswith('BSD'):
|
|
|
222d62 |
data_files.extend([
|
|
|
222d62 |
(ETC + '/NetworkManager/dispatcher.d/',
|
|
|
222d62 |
['tools/hook-network-manager']),
|
|
|
222d62 |
- (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
|
|
|
222d62 |
- (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')])
|
|
|
222d62 |
+ ('/usr/lib/udev/rules.d', [f for f in glob('udev/*.rules')])
|
|
|
222d62 |
])
|
|
|
297660 |
# Use a subclass for install that handles
|
|
|
297660 |
# adding on the right init system configuration files
|
|
|
297660 |
@@ -286,8 +271,6 @@ setuptools.setup(
|
|
|
222d62 |
scripts=['tools/cloud-init-per'],
|
|
|
222d62 |
license='Dual-licensed under GPLv3 or Apache 2.0',
|
|
|
222d62 |
data_files=data_files,
|
|
|
222d62 |
- install_requires=requirements,
|
|
|
222d62 |
- cmdclass=cmdclass,
|
|
|
222d62 |
entry_points={
|
|
|
222d62 |
'console_scripts': [
|
|
|
0a07cd |
'cloud-init = cloudinit.cmd.main:main',
|
|
|
222d62 |
diff --git a/tools/read-version b/tools/read-version
|
|
|
08c715 |
index 02c90643..79755f78 100755
|
|
|
222d62 |
--- a/tools/read-version
|
|
|
222d62 |
+++ b/tools/read-version
|
|
|
297660 |
@@ -71,32 +71,8 @@ version_long = None
|
|
|
297660 |
is_release_branch_ci = (
|
|
|
297660 |
os.environ.get("TRAVIS_PULL_REQUEST_BRANCH", "").startswith("upstream/")
|
|
|
297660 |
)
|
|
|
297660 |
-if is_gitdir(_tdir) and which("git") and not is_release_branch_ci:
|
|
|
222d62 |
- flags = []
|
|
|
222d62 |
- if use_tags:
|
|
|
222d62 |
- flags = ['--tags']
|
|
|
222d62 |
- cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
|
|
|
222d62 |
-
|
|
|
9dab26 |
- try:
|
|
|
9dab26 |
- version = tiny_p(cmd).strip()
|
|
|
9dab26 |
- except RuntimeError:
|
|
|
9dab26 |
- version = None
|
|
|
222d62 |
-
|
|
|
9dab26 |
- if version is None or not version.startswith(src_version):
|
|
|
222d62 |
- sys.stderr.write("git describe version (%s) differs from "
|
|
|
222d62 |
- "cloudinit.version (%s)\n" % (version, src_version))
|
|
|
0a07cd |
- sys.stderr.write(
|
|
|
0a07cd |
- "Please get the latest upstream tags.\n"
|
|
|
0a07cd |
- "As an example, this can be done with the following:\n"
|
|
|
0a07cd |
- "$ git remote add upstream https://git.launchpad.net/cloud-init\n"
|
|
|
0a07cd |
- "$ git fetch upstream --tags\n"
|
|
|
0a07cd |
- )
|
|
|
222d62 |
- sys.exit(1)
|
|
|
222d62 |
-
|
|
|
222d62 |
- version_long = tiny_p(cmd + ["--long"]).strip()
|
|
|
222d62 |
-else:
|
|
|
222d62 |
- version = src_version
|
|
|
222d62 |
- version_long = None
|
|
|
222d62 |
+version = src_version
|
|
|
222d62 |
+version_long = None
|
|
|
222d62 |
|
|
|
222d62 |
# version is X.Y.Z[+xxx.gHASH]
|
|
|
222d62 |
# version_long is None or X.Y.Z-xxx-gHASH
|
|
|
222d62 |
--
|
|
|
08c715 |
2.27.0
|
|
|
222d62 |
|