File: data.yaml

package info (click to toggle)
cloud-init 25.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,052 kB
  • sloc: python: 134,399; sh: 3,879; makefile: 128; javascript: 30; xml: 22
file content (46 lines) | stat: -rw-r--r-- 1,878 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cc_write_files:
  description: |
    Write out arbitrary content to files, optionally setting permissions.
    Parent folders in the path are created if absent. Content can be specified
    in plain text or binary. Data encoded with either base64 or binary gzip
    data can be specified and will be decoded before being written. Data can
    also be loaded from an arbitrary URI. For empty file creation, content can
    be omitted.

    .. note::
       If multi-line data is provided, care should be taken to ensure it
       follows YAML formatting standards. To specify binary data, use the YAML
       option ``!!binary``.

    .. note::
       Do not write files under ``/tmp`` during boot because of a race with
       ``systemd-tmpfiles-clean`` that can cause temporary files to be cleaned
       during the early boot process. Use ``/run/somedir`` instead to avoid
       a race (LP: #1707222).

    .. warning::
       Existing files will be overridden.
  examples:
  - comment: |
      Example 1: Write out base64-encoded content to ``/etc/sysconfig/selinux``.
    file: cc_write_files/example1.yaml
  - comment: |
      Example 2: Appending content to an existing file.
    file: cc_write_files/example2.yaml
  - comment: |
      Example 3: Provide gzipped binary content
    file: cc_write_files/example3.yaml
  - comment: |
      Example 4: Create an empty file on the system
    file: cc_write_files/example4.yaml
  - comment: >
      Example 5: Defer writing the file until after the package (Nginx) is
      installed and its user is created.
    file: cc_write_files/example5.yaml
  - comment: >
      Example 6: Retrieve file contents from a URI source, rather than inline.
      Especially useful with an external config-management repo, or for large
      binaries.
    file: cc_write_files/example6.yaml
  name: Write Files
  title: Write arbitrary files