diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-03-10 02:31:47 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-03-11 00:46:47 -0400 |
commit | f17693e030d88d0d2a85d92d506506c34a0fb111 (patch) | |
tree | 18ff0fc3e001e764809bf19122ff6456e869e0fe /meta-openstack/recipes-extended/cloud-init | |
parent | 4264b4b64cf6ec230d350a0ca950b72554724994 (diff) | |
download | meta-cloud-services-f17693e030d88d0d2a85d92d506506c34a0fb111.tar.gz |
cloud-init: create skeleton package
This creates a basic/skeleton cloud-init package that has the following
properties:
- working sysvinit scripts
- Wind River distro definition
- baseline cloud.cfg with no data source and "hands off" configuration
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-extended/cloud-init')
4 files changed, 244 insertions, 0 deletions
diff --git a/meta-openstack/recipes-extended/cloud-init/cloud-init/cloud-init-source-local-lsb-functions.patch b/meta-openstack/recipes-extended/cloud-init/cloud-init/cloud-init-source-local-lsb-functions.patch new file mode 100644 index 0000000..869fb31 --- /dev/null +++ b/meta-openstack/recipes-extended/cloud-init/cloud-init/cloud-init-source-local-lsb-functions.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 72dd3b4b38705442d821fe97a40061f23e748769 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
3 | Date: Thu, 6 Mar 2014 01:55:09 -0500 | ||
4 | Subject: [PATCH] cloud-init: source local lsb functions | ||
5 | |||
6 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
7 | --- | ||
8 | sysvinit/debian/cloud-config | 1 + | ||
9 | sysvinit/debian/cloud-final | 1 + | ||
10 | sysvinit/debian/cloud-init | 1 + | ||
11 | sysvinit/debian/cloud-init-local | 1 + | ||
12 | 4 files changed, 4 insertions(+) | ||
13 | |||
14 | diff --git a/sysvinit/debian/cloud-config b/sysvinit/debian/cloud-config | ||
15 | index 53322748ac65..7874dcfab9b0 100644 | ||
16 | --- a/sysvinit/debian/cloud-config | ||
17 | +++ b/sysvinit/debian/cloud-config | ||
18 | @@ -30,6 +30,7 @@ SCRIPTNAME=/etc/init.d/$NAME | ||
19 | # Depend on lsb-base (>= 3.2-14) to ensure that this file is present | ||
20 | # and status_of_proc is working. | ||
21 | . /lib/lsb/init-functions | ||
22 | +. /etc/init.d/functions | ||
23 | |||
24 | if init_is_upstart; then | ||
25 | case "$1" in | ||
26 | diff --git a/sysvinit/debian/cloud-final b/sysvinit/debian/cloud-final | ||
27 | index 55afc8b0678a..661314f0b64c 100644 | ||
28 | --- a/sysvinit/debian/cloud-final | ||
29 | +++ b/sysvinit/debian/cloud-final | ||
30 | @@ -32,6 +32,7 @@ SCRIPTNAME=/etc/init.d/$NAME | ||
31 | # Depend on lsb-base (>= 3.2-14) to ensure that this file is present | ||
32 | # and status_of_proc is working. | ||
33 | . /lib/lsb/init-functions | ||
34 | +. /etc/init.d/functions | ||
35 | |||
36 | if init_is_upstart; then | ||
37 | case "$1" in | ||
38 | diff --git a/sysvinit/debian/cloud-init b/sysvinit/debian/cloud-init | ||
39 | index 48fa04233f00..d3ccec99bacc 100755 | ||
40 | --- a/sysvinit/debian/cloud-init | ||
41 | +++ b/sysvinit/debian/cloud-init | ||
42 | @@ -30,6 +30,7 @@ SCRIPTNAME=/etc/init.d/$NAME | ||
43 | # Depend on lsb-base (>= 3.2-14) to ensure that this file is present | ||
44 | # and status_of_proc is working. | ||
45 | . /lib/lsb/init-functions | ||
46 | +. /etc/init.d/functions | ||
47 | |||
48 | if init_is_upstart; then | ||
49 | case "$1" in | ||
50 | diff --git a/sysvinit/debian/cloud-init-local b/sysvinit/debian/cloud-init-local | ||
51 | index 802ee8e9f386..c309e8347324 100644 | ||
52 | --- a/sysvinit/debian/cloud-init-local | ||
53 | +++ b/sysvinit/debian/cloud-init-local | ||
54 | @@ -29,6 +29,7 @@ SCRIPTNAME=/etc/init.d/$NAME | ||
55 | # Depend on lsb-base (>= 3.2-14) to ensure that this file is present | ||
56 | # and status_of_proc is working. | ||
57 | . /lib/lsb/init-functions | ||
58 | +. /etc/init.d/functions | ||
59 | |||
60 | if init_is_upstart; then | ||
61 | case "$1" in | ||
62 | -- | ||
63 | 1.7.10.4 | ||
64 | |||
diff --git a/meta-openstack/recipes-extended/cloud-init/cloud-init/cloud.cfg b/meta-openstack/recipes-extended/cloud-init/cloud-init/cloud.cfg new file mode 100644 index 0000000..f868936 --- /dev/null +++ b/meta-openstack/recipes-extended/cloud-init/cloud-init/cloud.cfg | |||
@@ -0,0 +1,99 @@ | |||
1 | # The top level settings are used as module | ||
2 | # and system configuration. | ||
3 | |||
4 | # A set of users which may be applied and/or used by various modules | ||
5 | # when a 'default' entry is found it will reference the 'default_user' | ||
6 | # from the distro configuration specified below | ||
7 | users: | ||
8 | - default | ||
9 | |||
10 | # If this is set, 'root' will not be able to ssh in and they | ||
11 | # will get a message to login instead as the above $user (ubuntu) | ||
12 | disable_root: False | ||
13 | |||
14 | # This will cause the set+update hostname module to not operate (if true) | ||
15 | preserve_hostname: false | ||
16 | manage_etc_hosts: %MANAGE_HOSTS% | ||
17 | |||
18 | datasource_list: | ||
19 | - None | ||
20 | |||
21 | # Example datasource config | ||
22 | # datasource: | ||
23 | # Ec2: | ||
24 | # metadata_urls: [ 'blah.com' ] | ||
25 | # timeout: 5 # (defaults to 50 seconds) | ||
26 | # max_wait: 10 # (defaults to 120 seconds) | ||
27 | |||
28 | # The modules that run in the 'init' stage | ||
29 | cloud_init_modules: | ||
30 | - migrator | ||
31 | - seed_random | ||
32 | - bootcmd | ||
33 | - write-files | ||
34 | - growpart | ||
35 | - set_hostname | ||
36 | - update_hostname | ||
37 | - update_etc_hosts | ||
38 | - ca-certs | ||
39 | - rsyslog | ||
40 | - users-groups | ||
41 | - ssh | ||
42 | |||
43 | # The modules that run in the 'config' stage | ||
44 | cloud_config_modules: | ||
45 | # Emit the cloud config ready event | ||
46 | # this can be used by upstart jobs for 'start on cloud-config'. | ||
47 | - emit_upstart | ||
48 | - disk_setup | ||
49 | - mounts | ||
50 | - ssh-import-id | ||
51 | - locale | ||
52 | - set-passwords | ||
53 | - grub-dpkg | ||
54 | - apt-pipelining | ||
55 | - apt-configure | ||
56 | - package-update-upgrade-install | ||
57 | - landscape | ||
58 | - timezone | ||
59 | - puppet | ||
60 | - chef | ||
61 | - salt-minion | ||
62 | - mcollective | ||
63 | - disable-ec2-metadata | ||
64 | - runcmd | ||
65 | - byobu | ||
66 | |||
67 | # The modules that run in the 'final' stage | ||
68 | cloud_final_modules: | ||
69 | - rightscale_userdata | ||
70 | - scripts-per-once | ||
71 | - scripts-per-boot | ||
72 | - scripts-per-instance | ||
73 | - scripts-user | ||
74 | - ssh-authkey-fingerprints | ||
75 | - keys-to-console | ||
76 | - phone-home | ||
77 | - final-message | ||
78 | - power-state-change | ||
79 | |||
80 | # set the hostname | ||
81 | hostname: %HOSTNAME% | ||
82 | |||
83 | # System and/or distro specific settings | ||
84 | # (not accessible to handlers/transforms) | ||
85 | system_info: | ||
86 | # This will affect which distro class gets used | ||
87 | distro: windriver | ||
88 | # Default user name + that default users groups (if added/used) | ||
89 | default_user: | ||
90 | name: root | ||
91 | lock_passwd: False | ||
92 | groups: [adm, audio, cdrom, dialout, dip, floppy, netdev, plugdev, sudo, video] | ||
93 | sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
94 | shell: /bin/bash | ||
95 | # Other config here will be given to the distro class and/or path classes | ||
96 | paths: | ||
97 | cloud_dir: /var/lib/cloud/ | ||
98 | templates_dir: /etc/cloud/templates/ | ||
99 | ssh_svcname: ssh | ||
diff --git a/meta-openstack/recipes-extended/cloud-init/cloud-init/distros-add-windriver-skeleton-distro-file.patch b/meta-openstack/recipes-extended/cloud-init/cloud-init/distros-add-windriver-skeleton-distro-file.patch new file mode 100644 index 0000000..f52faf3 --- /dev/null +++ b/meta-openstack/recipes-extended/cloud-init/cloud-init/distros-add-windriver-skeleton-distro-file.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 6ad7caf6410237f3b1bed6ff4d9f0423e69afcd6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
3 | Date: Mon, 10 Mar 2014 00:57:18 -0400 | ||
4 | Subject: [PATCH] distros: add windriver skeleton distro file | ||
5 | |||
6 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
7 | --- | ||
8 | cloudinit/distros/windriver.py | 24 ++++++++++++++++++++++++ | ||
9 | 1 file changed, 24 insertions(+) | ||
10 | create mode 100644 cloudinit/distros/windriver.py | ||
11 | |||
12 | diff --git a/cloudinit/distros/windriver.py b/cloudinit/distros/windriver.py | ||
13 | new file mode 100644 | ||
14 | index 000000000000..8eec13fe2207 | ||
15 | --- /dev/null | ||
16 | +++ b/cloudinit/distros/windriver.py | ||
17 | @@ -0,0 +1,24 @@ | ||
18 | +# vi: ts=4 expandtab | ||
19 | +# | ||
20 | +# Copyright (C) 2014 WindRiver | ||
21 | +# | ||
22 | +# This program is free software: you can redistribute it and/or modify | ||
23 | +# it under the terms of the GNU General Public License version 3, as | ||
24 | +# published by the Free Software Foundation. | ||
25 | +# | ||
26 | +# This program is distributed in the hope that it will be useful, | ||
27 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
28 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
29 | +# GNU General Public License for more details. | ||
30 | +# | ||
31 | +# You should have received a copy of the GNU General Public License | ||
32 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
33 | + | ||
34 | +from cloudinit.distros import debian | ||
35 | +from cloudinit import log as logging | ||
36 | + | ||
37 | +LOG = logging.getLogger(__name__) | ||
38 | + | ||
39 | + | ||
40 | +class Distro(debian.Distro): | ||
41 | + pass | ||
42 | -- | ||
43 | 1.7.10.4 | ||
44 | |||
diff --git a/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.4.bb b/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.4.bb new file mode 100644 index 0000000..f639d4b --- /dev/null +++ b/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.4.bb | |||
@@ -0,0 +1,37 @@ | |||
1 | DESCRIPTION = "Init scripts for use on cloud images" | ||
2 | HOMEPAGE = "https://launchpad.net/cloud-init" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "GPLv3" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504" | ||
6 | |||
7 | PR = "0" | ||
8 | |||
9 | SRC_URI = "https://launchpad.net/cloud-init/trunk/${PV}/+download/${BPN}-${PV}.tar.gz \ | ||
10 | file://cloud-init-source-local-lsb-functions.patch \ | ||
11 | file://distros-add-windriver-skeleton-distro-file.patch \ | ||
12 | file://cloud.cfg" | ||
13 | |||
14 | SRC_URI[md5sum] = "65053a7b2917ad1c26dc0a4d144b59c0" | ||
15 | SRC_URI[sha256sum] = "34152e0168c2ffc06284b4fe01ff43f856219228ddb995d5afe4f9a77420d779" | ||
16 | |||
17 | S = "${WORKDIR}/${BPN}-${PV}" | ||
18 | |||
19 | DISTUTILS_INSTALL_ARGS_append = " ${@base_contains('DISTRO_FEATURES', 'sysvinit', '--init-system=sysvinit_deb', '', d)}" | ||
20 | DISTUTILS_INSTALL_ARGS_append = " ${@base_contains('DISTRO_FEATURES', 'systemd', '--init-system=systemd', '', d)}" | ||
21 | |||
22 | MANAGE_HOSTS ?= "False" | ||
23 | HOSTNAME ?= "" | ||
24 | |||
25 | do_install_append() { | ||
26 | sed -e "s:%MANAGE_HOSTS%:${MANAGE_HOSTS}:g" -i ${WORKDIR}/cloud.cfg | ||
27 | sed -e "s:%HOSTNAME%:${HOSTNAME}:g" -i ${WORKDIR}/cloud.cfg | ||
28 | install -m 0755 ${WORKDIR}/cloud.cfg ${D}${sysconfdir}/cloud/cloud.cfg | ||
29 | } | ||
30 | |||
31 | inherit setuptools update-rc.d | ||
32 | |||
33 | FILES_${PN} += "${sysconfdir}/* \ | ||
34 | ${datadir}/*" | ||
35 | |||
36 | INITSCRIPT_PACKAGES = "${PN}" | ||
37 | INITSCRIPT_NAME_${BPN} = "cloud-init" \ No newline at end of file | ||