Commit Graph

33 Commits

Author SHA1 Message Date
Adrian Vladu c9eaf6a9b6 docs: update network config v1 document url
The current latest version of the cloud-init upstream
document URL has changed. Added the latest known good
version for the URL.

Change-Id: Ia2d48bea644a4d78fdf79792451a2f1d4c389f96
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
2024-04-04 18:05:56 +03:00
Adrian Vladu 1a28d39c72 bsdtar: check if tool path exists
Check if the configuration value of bsdtar_path does exist as a path
before trying to execute the binary.

Updated the tutorial reference of bsdtar to FreeBSD instead of Ubuntu.

Change-Id: Ieba5da2f330aa11c40cce6c2ae9de40155f33b07
2023-01-19 14:52:49 +02:00
Adrian Vladu e09af5f15b tox: fix py3 / docs gates
Bump version of tox to 4.02 and add requirements for the docs.

Change-Id: Ib4131d1278d742a4730935240b59e6b0e3d94555
2023-01-18 16:05:56 +02:00
Adrian Vladu 1a32d738de opendev: bumped gates to python 3.9/3.10
Python 3.6/3.7 are no longer supported for the latest releasese of
the OpenStack packages like oslo or coverage, thus switching to the Zed
OpenStack release gates, which have support for 3.8/3.9/3.10 Python
versions.

For gates to pass, the docs required a defined language to be set ("en"),
while the crypto unit tests required a method signature fix when running
on Python 3.9/3.10.

The version test__check_latest_version* unit tests started failing
in a transient pattern because of the
pbr.version.VersionInfo().release_string() throwing the following error:
"NotImplementedError: cannot instantiate 'WindowsPath' on your system".
This required to have the cloudbaseinit.version.get_version mocked for a
reliable unit test run on Linux.

Change-Id: I4748d1258c072c377825474e1116347b0a085c56
2022-09-07 20:26:34 +03:00
yoerg 39e2f6faf4 Support retrieving admin_username from OpenStack metadata
Allows giving an instance an individual cloud username, e.g. for license servers, while still retrieving SSH public keys for that user from OpenStack.

Change-Id: I078380ef8f74b30105fd44378045df8b1260acbc
2021-01-20 12:05:11 +01:00
Adrian Vladu 246db50591 nocloud: support for cloud-init network version 1
Added support for NoCloud service with Networking Config Version 1:
https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v1.html

Supported configuration types: Physical, Bond, Vlan and Nameserver.
Unsupported configuration types: Bridge, Route.

NoCloud metadata folder should contain a file network-config.
If no file is found, it falls back to using the contents for network-interfaces
key from the metadata file.

Example:

```yaml
version: 1
config:
   - type: physical
     name: interface0
     mac_address: "52:54:00:12:34:00"
     mtu: 1450
     subnets:
        - type: static
          address: 192.168.1.10
          netmask: 255.255.255.0
          dns_nameservers:
            - 192.168.1.11
   - type: bond
     name: bond0
     bond_interfaces:
       - gbe0
       - gbe1
     mac_address: "52:54:00:12:34:00"
     params:
       bond-mode: active-backup
       bond-lacp-rate: false
     mtu: 1450
     subnets:
        - type: static
          address: 192.168.1.10
          netmask: 255.255.255.0
          dns_nameservers:
            - 192.168.1.11
   - type: vlan
     name: vlan0
     vlan_link: eth1
     vlan_id: 150
     mac_address: "52:54:00:12:34:00"
     mtu: 1450
     subnets:
        - type: static
          address: 192.168.1.10
          netmask: 255.255.255.0
          dns_nameservers:
            - 192.168.1.11
   - type: nameserver
     address:
       - 192.168.23.2
       - 8.8.8.8
     search: acme.local
```

Change-Id: Idc413f6f9f001b2327c33a796e9ed494be28ce26
2020-07-01 19:08:47 +03:00
Adrian Vladu 107bdfaceb packet: add phone_home and post_password support
Add support for the Packet features:

  * phone home - after provisioning is ready, an empty HTTP POST request
  is performed to the phone_home_url
  * post user password - a random password is generated for the default
  user, the password gets encrypted using the encryption public SSH key
  and posted to the phone_home_url

Change-Id: Ib3e405b6b5bb4ca65d047c756513b9d6f87cf6de
2020-05-27 13:12:15 +03:00
Adrian Vladu 4b0d94cd0f Add NoCloudConfigDriveService metadata provider
Add support for NoCloud metadata provider, where the metadata
is provided on a config-drive (vfat or iso9660) with the label
cidata or CIDATA.

The folder structure for NoCloud is:

  * /user-data
  * /meta-data

The user-data and meta-data files respect the EC2 metadata
service format.

Supported features for the NoCloud metadata service:
  * instance id
  * hostname
  * plublic keys
  * static network configuration (Debian format)
  * user data

More information:
cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html

Change-Id: Ib434cf2b2b21bf9faa58e05ba40eb0135385c9ea
Implements: blueprint nocloud-metadata-support
2020-04-03 20:10:09 +03:00
Zuul 9e05ef0e91 Merge "Add Google Cloud Engine metadata service" 2020-02-26 19:22:46 +00:00
Adrian Vladu 29105932c0 Add Google Cloud Engine metadata service
Add cloudbaseinit.metadata.services.gceservice.GCEService that
supports Google Cloud Engine.

Supported features for the metadata service:
  * instance id
  * hostname
  * userdata
  * ssh keys

Change-Id: I9e5e2cbcaa0953fc0c0ae8117e258713ac6443b7
2020-02-26 13:26:05 +02:00
Adrian Vladu 75c6a0e0f8 Fix Py27 cloud-config ordering
On Py27, the yaml module implementation uses a normal dictionary for
implementation, resulting in arbitrary order for the parsed yaml.

If the config option cloud_config_plugins is not set or empty, fallback
to the default order defined in the factory.

Config option `cloud_config_plugins` is now used for filtering the cloud
config plugins to be executed, which was the original intended behaviour.

Change-Id: I59ea56e473ab343a826ff8c38787cb7f11cebd27
2020-02-06 12:49:40 +02:00
Adrian Vladu a77477e16e Add metadata servvice VMwareGuestInfoService
VMwareGuestInfoService is a metadata service which uses VMware's
rpctool to extract guest metadata and userdata configured for machines
running on VMware hypervisors.

The implementation is similar to:
https://github.com/vmware/cloud-init-vmware-guestinfo

Supported features for the metadata service:
  * instance id
  * hostname
  * admin username
  * admin password
  * public SSH keys
  * userdata

Configuration options:
```ini

[vmwarequestinfo]
vmware_rpctool_path=%ProgramFiles%/VMware/VMware Tools/rpctool.exe

```

The VMware RPC tool used to query the instance metadata and userdata
needs to be present at the config option path.

Both json and yaml are supported as metadata formats.
The metadata / userdata can be encoded in base64, gzip or gzip+base64.

Example metadata in yaml format:

```yaml
instance-id: cloud-vm
local-hostname: cloud-vm
admin-username: cloud-username
admin-password: Passw0rd
public-keys-data: |
  ssh-key 1
  ssh-key 2
```

This metadata content needs to be sent as string in the guestinfo
dictionary, thus needs to be converted to base64 (it is recommended to
gzip it too).

To convert to gzip+base64 format:

```bash
cat metadata.yml | gzip.exe -9 | base64.exe -w0
```

Co-Authored-By: Rui Lopes <rgl@ruilopes.com>
Change-Id: I6a8430e87ee03d2e8fdd2685b05e60c5c0ffb5be
2020-01-29 20:35:23 +02:00
Zuul ea51dfb053 Merge "Implement cloud-config users and groups plugins" 2020-01-21 14:52:26 +00:00
Adrian Vladu c6a4c1e427 Updated cloud-config docs
Added runcmd, ntp and cloud-config execution / reboot
details.

Updated the name of the EmptyMetadataService from "EMPTY" to
the correct one and added notes regarding plugins re-execution
and idempotency.

Change-Id: I8e53fc1ca3e9a96c0e56b250f9714e2f719366b0
2020-01-21 14:01:03 +02:00
Adrian Vladu 6ede055475 Implement cloud-config users and groups plugins
Add support for cloud-config users and groups creation.

For Windows, the following format is supported:

groups:
  - windows-group: [user1, user2]
  - cloud-users

users:
  -
    name: brian
    gecos: 'Brian Cohen'
    primary_group: Users
    groups: cloud-users
    passwd: StrongPassw0rd
    inactive: False
    expiredate: 2020-10-01
    ssh_authorized_keys:
      - first key
      - second key

The passwords for Windows users are required to be in
plain text. On *nix systems, the passwords are hashed.

If the password is not present, a random password will
be set.

Fixes: https://github.com/cloudbase/cloudbase-init/issues/26

Change-Id: I035f92849a59a8370df30a6de41f66f5fb2300af
2020-01-21 13:53:09 +02:00
Adrian Vladu b5e3c42f39 Added empty metadata service: EmptyMetadataService
The empty metadata service can be used to run plugins that do not
rely on metadata service information, like setting NTP, MTU,
extending volumes, local scripts execution, licensing, etc.

It can be used also as a fallback metadata service, in case no other
previous metadata service could be loaded.

EmptyMetadataService does not support the following plugins:
  * cloudbaseinit.plugins.windows.createuser.CreateUserPlugin
  * cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin
  * cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin
  * cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin

If any of the plugins defined above are executed,
they will fail with exception NotExistingMetadataException. The reason
for the hardcoded failure is that these plugins rely on metadata to execute
correctly. If metadata like username or password is not provided,
these plugins can lock or misconfigure the user, leading to unwanted problems.

Implements: blueprint empty-metadata-provider
Change-Id: I5fb88a07bf72321d0f66b16d151bf6059b448580
2020-01-13 16:39:44 +02:00
Adrian Vladu 0ae70d5fe4 docs: Updated and fixed various doc parts
The following documentation parts were updated:

  * copyright years
  * stable installer urls were added
  * PowerShell userdata header added (#ps1)
  * Userdata types fixed
  * Updated all the services config options
  * Removed deprecated options for services
  * Added Packet metadata service
  * Added Azure metadata service
  * Replaced return code with exit code in tutorial
    (return code is not correct)
  * Updated all the plugins config options
  * Added all the undocumented plugins
  * Added retry_count / retry_count_interval info
    for all http based services

Change-Id: I6fdbdcaf45dec841e4080028d7d90cbbf6a6cb75
2019-12-10 17:33:08 +02:00
Adrian Vladu 208405289e docs: change theme to sphinx_rtd_theme
Changed docs theme to a better, mobile friendly one:
https://github.com/readthedocs/sphinx_rtd_theme

The duplicate labels were removed, as the sphinx extension
sphinx.ext.autosectionlabel requires unique titles (labels).

Change-Id: Ife17206c3b2370250388692a9330585f5193e450
2019-11-15 19:06:09 +02:00
Adrian Vladu e74570e01e docs: show cloudbase-init version
Previously, the docs version was hardcoded to 1.0,
which was incorrect.

Now the version and release field will show the
actual cloudbase-init package version.

Example: 0.9.11 or 0.9.12
Change-Id: Ide4ed289029e25c39c07fec53086ff8868ce4063
2019-11-15 15:16:55 +02:00
Rui Lopes 8a03b4700e Fix typo in userdata docs
Change-Id: Ia17cd09eed0f790f00a3acff3b0541fd0cf784c1
2019-10-18 13:40:02 +03:00
Andreas Jaeger e370fc937c Update docs building jobs
Replace build-sphinx job with tox-docs (using template
build-openstack-docs-pti) job as best practice for building docs.
Update tox.ini for this and remove now obsolete section from setup.cfg.

Fix doc building: Remove option from doc/source/conf.py for an unused
directory.

The tox.ini file already contains python3 for releasenotes, update the
job now to do this as well.

Change-Id: I7552c802a99f0338ff6a5a3bba1f24902c55bed4
2019-07-12 08:46:35 +02:00
Jose Dillet 6eeeb607f7 Add OVF metadata service
Implements support for OVF metadata service.

Sample ovf-env.xml file:
https://github.com/cloud-init/cloud-init/blob/master/doc/sources/ovf/example/ovf-env.xml

Change-Id: I262baa9138599a7462ec2069fd2a142df0a4eb1e
2019-06-28 10:56:19 +03:00
Zuul 05b4d4a8ee Merge "userdata: add #cloud-config in examples" 2019-06-14 14:37:54 +00:00
Zuul 6c3f3044fb Merge "Fix the configuration error in the document." 2019-06-10 11:45:39 +00:00
Lucian Petrut 0d8b9ec347 docs: add automatically generated list of cfg opts
This change will include an automatically generated list of
config options in the cloudbase-init docs.

It's useful as some config options are not currently mentioned in
the docs and it's also nice to be able to have a quick overview
of all available options without having to go through the code.
You can also send links to certain config options or groups.

Note that long config opt lines are not wrapped and look quite bad,
especially with the current theme (may consider switching to some
other theme, maybe the "alabaster" one included by default by
sphinx). Still better than not having this at all though.

We're also adding the zuul jobs that validate release notes and
docs, required for testing this patch.

Change-Id: Ibaff3a91e7f1345aaaac0c29b995e7c25b9e4669
2019-06-07 16:45:02 +03:00
sunjiazz 1189ac5dd2 Fix the configuration error in the document.
Set the “plugins=cloudbaseinit.plugins.windows.setuserpassword.
SetUserPasswordPlugin” field in the configuration file as
suggested by cloudbase-init/doc/plugins.rst,but it can not take effect.
In fact it should be set to
“plugins=cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin”,
this is the error described in cloudbase-init/doc/plugins.rst,
cause inconvenient to use

Change-Id: Iad2f98799684fe92992fbbce7f6632138d6fba5d
Closes-bug: #1747874
2019-05-06 03:16:46 +00:00
Chen Hanxiao d16ec2bcd4 userdata: add #cloud-config in examples
We forced the user_data starts with #cloud-config.
But the example missed this part.

Change-Id: Iba1bb7315305bdb269f3abfac11b6fc0ba1d67fe
Signed-off-by: Chen Hanxiao <chenhx@certusnet.com.cn>
2018-07-04 15:22:12 +08:00
Jenkins 8c6ab772a6 Merge "Remove extra (main) from the documentation" 2015-10-19 13:02:01 +00:00
Claudiu Belu 59bbbe09f8 Updates project repo to openstack
All stackforge projects have been moved to openstack.

Change-Id: I90f57cd5a5d96ed73a128f5b2cef3ae2a945b9c5
2015-10-19 01:17:26 +03:00
Cosmin Poieana 4ee6a2bf21 Remove extra (main) from the documentation
Change-Id: Iec87c77ef4f5f6ab18cbb489bdfffcebb832c761
2015-10-16 20:06:55 +03:00
Cosmin Poieana ffae5f7653 Document the plugin stages feature
Which stages are available and which plugins belong to them.

Change-Id: I5bcb3bbd6a9facba8a4a0bbd5a8fe340747aca9a
2015-10-13 20:23:43 +03:00
Cosmin Poieana a48c33e280 Add cloudbase-init Sphinx documentation
Document plugins, metadata services, configuration file,
how the project is supposed to work and some user related usecases.

Change-Id: I184a9409a9e9173c346f0ab149cb7d78ed87e0b3
2015-09-04 20:46:15 +03:00
Alessandro Pilotti 23ddd33fa4 Fixes requirements on Linux
Platform specific requirements can not be included in requirements.txt

Includes also:

* testr configuration file
* PEP8 fixes
* Unit test fixes for passing OpenStack Jenkins checks

Change-Id: I6f3f367f3316e0b506bb62e66d7671f9e52c72b5
Closes-Bug: #1376816
2014-10-05 22:20:58 +03:00