155 Commits
Author SHA1 Message Date
Auke Kok 9d13049eb3 Fetch both ssh key and userdata in one http conversation. 2017-05-05 15:34:52 -07:00
Auke Kok 5056dc93ef Do not hard code path to ucd binary, instead pass $bindir 2017-05-02 10:28:21 -07:00
Auke Kok 5531716c67 Makedev will be in <sys/sysmacros.h>. 2017-05-02 10:10:46 -07:00
Auke Kok 4e21debad3 Convert to agreed upon code style for braces. 2017-05-02 10:08:50 -07:00
Auke Kok 5f80692011 ucd AWS helper.
The ucd-aws program fetches the user-data for an AMI instance
over http from 169.254.169.254, and passes it back to ucd.

The service is not supposed to be enabled unless you are running
on AWS, as it is highly specific to that cloud.
2017-04-28 14:48:10 -07:00
Ikey Doherty 574c759b30 lib: Ensure pwd_buf is always freed in write_ssh_keys
Prior to this change, a NULL pw_dir would result in pwd_buf being leaked after
write_ssh_keys is called. Granted, it's a minor leak, and only potential, but
should still be fixed regardless.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2016-07-27 14:43:52 -07:00
Ikey Doherty 2c7ba9a934 Replace all instances of clr-cloud-init with micro-config-drive
The project has been renamed from clr-cloud-init to clearly communicate the
scope and target of the project. This change simply ensures all the source
files are now consistent in their agreement of the project name.

The (C) usage was also swapped for ©, simply because it is the proper symbol
and looks better.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2016-07-27 14:43:52 -07:00
Julio Montes b4fec921d3 remove network code (#21)
* remove no-network option

Signed-off-by: Julio Montes <julio.montes@intel.com>

* update documentation

Signed-off-by: Julio Montes <julio.montes@intel.com>

* update service files

Signed-off-by: Julio Montes <julio.montes@intel.com>
2016-06-22 15:11:59 -07:00
Auke Kok f9f2dd5b9f Remove CURL support entirely. (#20)
With this change, only config-drive is effectively supported.
2016-06-09 11:33:23 -07:00
Divya Thaluru 087eb25308 Added tdnf package manager (#16) 2016-05-19 10:37:25 -07:00
dthaluru 427736cf72 Updated yum package manager
Added assumeyes as additional argument to yum install command
to automatically answer interactive questions as 'yes'
2016-05-18 11:56:34 -07:00
Auke Kok 45b46affd6 Allow package manager selection.
Supported package managers are: swupd (default), yum, dnf, apt.

If configure is passwd --with-packagemgr=<pkgmgr>, then the appropriate
calls to dnf/yum etc. are used instead of `swupd`. This affects the
`packge_upgrade' and `packages' directives, exclusively.

This is determined at compile time, without checking for dependencies
being actually present. This seems preferable than to try and determine
at runtime what support is present.
2016-05-12 14:30:46 -07:00
Julio Montes a102bba258 auto-prepend username to sudo directives
update users.yaml example
2016-05-11 11:23:27 -05:00
Julio Montes 73d1aeb4ea add outdir parameter to curl_fetch_file
files downloaded by curl can be saved in
a safe directory
2016-04-21 14:27:22 -05:00
Julio Montes 5dddbbdc44 Use clr-cloud-init's datadir instead of /tmp to process data 2016-04-21 13:50:45 -05:00
Julio Montes 5218ce78cf use GHashTable to get and run metadata handlers 2016-04-19 12:05:20 -05:00
Julio Montes 3d5ac4b6b7 fix copy user data file 2016-04-15 16:49:03 -05:00
Julio Montes e3a5bf3eab Process openstack user data once per boot 2016-04-15 16:10:20 -05:00
Julio Montes 9023f624fb add cache to get_boot_id 2016-04-15 16:00:45 -05:00
Julio Montes f278175f6d Process openstack metadata once per boot 2016-04-15 15:53:08 -05:00
Julio Montes 08bf9f07cc add function to get boot id
implement get_boot_id function
2016-04-15 14:42:26 -05:00
Julio Montes aae98b9af5 change default user password when it already exists 2016-04-15 11:54:34 -05:00
Julio Montes b99c8494b8 Fix repeated sudo directives in sudoers files 2016-04-15 11:44:54 -05:00
Julio Montes c9748e3350 add condition to create default user account once 2016-04-15 11:31:29 -05:00
Julio Montes 55db5e865f fix userdata file not found 2016-04-15 10:30:19 -05:00
Julio Montes fa3099504f fix g_strlcpy assertion when userdata is not found 2016-04-15 10:26:40 -05:00
Julio Montes 2d4e5d2cdc Add cache in is_first_boot to improve performance 2016-04-15 09:03:28 -05:00
Julio Montes 6deec17991 simplify write_file function
replace GString by char* in write_file function
2016-04-14 16:05:18 -05:00
Julio Montes 90d405a2cb replace chmod by fchmod 2016-04-14 15:56:32 -05:00
Julio Montes 381709279a style fix
replace '\0' by 0
2016-04-14 15:17:12 -05:00
Julio Montes 94ac50c47f Fix to get and process userdata once 2016-04-14 14:41:04 -05:00
Julio Montes 9cf9d1eda6 fix copy kernel boot id
fix copy_file function to set mode after sendfile
2016-04-14 12:04:09 -05:00
Julio Montes 448b9060d6 fix save instance id failed 2016-04-13 16:28:34 -05:00
Julio Montes 48e1ada26c replace get_boot_info by is_first_boot
is_first_boot uses kernel boot id to identify
the first boot

modify save_instance_id in order to work together with is_first_boot
2016-04-13 15:56:52 -05:00
Julio Montes 1c97e18f07 Split cloud-init service
cloud-init-pre-network:
runs before network service.
this service gets metadata from local datasources
in order to configure network stuff before network service
and configures the instance on its first booot

cloud-init:
runs after network service and will get userdata/metadata
from datasources(local/network). This service fixes disk
and filesystem

add first-boot-setup and no-network options
update documentation
2016-04-13 15:53:25 -05:00
Julio Montes 3c276985e8 lock root account and create default user only when a datasource is found 2016-03-29 16:29:50 -06:00
Julio Montes b59627e781 implement fbootcmd ccmodule
fbootcmd ccmodule will run system commands only
on first boot
2016-02-25 15:16:47 -06:00
Julio Montes d86fe138c7 use GString to run commands at runcmd ccmodule
Using GString is safer that use static char arrays
2016-02-25 14:56:49 -06:00
Julio Montes 16c3d6070f fix to save instance id when metadata service is used in openstack datasource
add some logs
2016-02-11 15:08:18 -06:00
Julio Montes 5ea1e46dce add logs to know instance id status
get_boot_info uses cache variables at beginning
2016-02-11 15:03:27 -06:00
Julio Montes b741fc1028 Run main loop after join threads
this change is to avoid sync problems
between async_task_exec and async_task_finish
2016-02-11 13:35:36 -06:00
Julio Montes 79878c5455 add log to see when main loop is running 2016-02-10 14:38:27 -06:00
Julio Montes 37709bad93 fix memory leaks
replace getgrnam with getgrnam_r and getpwnam with getpwnam_r
because they are thread safe functions
2016-02-09 14:50:14 -06:00
Julio Montes f73c5e432b fix security hole escaping special characters at async_task_exec 2016-02-08 15:25:26 -06:00
Julio Montes d26a2a3335 add single quotes to arguments in groups ccmodule 2016-02-05 15:56:43 -06:00
Julio Montes 423b30b37a remove function to scape characters in users ccmodule 2016-02-05 15:56:08 -06:00
Julio Montes 3aaaadf9dc fix security hole escaping special characters
fix possible command injection
2016-02-05 15:54:25 -06:00
Julio Montes 248f8013d5 openstack datasource sets hostname only at first boot 2016-02-04 14:28:43 -06:00
Julio Montes 90b92c4119 improve get_boot_info to cache boot info 2016-02-04 11:55:44 -06:00
Julio Montes 71210af2a4 finish async task before datasource
this change is to avoid blob data in threads
2016-02-04 11:31:22 -06:00