github.com/canonical/ubuntu-image@v0.0.0-20240430122802-2202fe98b290/internal/statemachine/testdata/user-data (about)

     1  #cloud-config
     2  
     3  # This is the user-data configuration file for cloud-init. By default this sets
     4  # up an initial user called "ubuntu" with password "ubuntu", which must be
     5  # changed at first login. However, many additional actions can be initiated on
     6  # first boot from this file. The cloud-init documentation has more details:
     7  #
     8  # https://cloudinit.readthedocs.io/
     9  #
    10  # Please note that the YAML format employed by this file is sensitive to
    11  # differences in whitespace; if you are editing this file in an editor (like
    12  # Notepad) which uses literal tabs, take care to only use spaces for
    13  # indentation. See the following link for more details:
    14  #
    15  # https://en.wikipedia.org/wiki/YAML
    16  #
    17  # Some additional examples are provided in comments below the default
    18  # configuration.
    19  
    20  # On first boot, set the (default) ubuntu user's password to "ubuntu" and
    21  # expire user passwords
    22  chpasswd:
    23    expire: true
    24    list:
    25    - ubuntu:ubuntu
    26  
    27  # Enable password authentication with the SSH daemon
    28  ssh_pwauth: true
    29  
    30  ## On first boot, use ssh-import-id to give the specific users SSH access to
    31  ## the default user
    32  #ssh_import_id:
    33  #- lp:my_launchpad_username
    34  #- gh:my_github_username
    35  
    36  ## Add users and groups to the system, and import keys with the ssh-import-id
    37  ## utility
    38  #groups:
    39  #- robot: [robot]
    40  #- robotics: [robot]
    41  #- pi
    42  #
    43  #users:
    44  #- default
    45  #- name: robot
    46  #  gecos: Mr. Robot
    47  #  primary_group: robot
    48  #  groups: users
    49  #  ssh_import_id: foobar
    50  #  lock_passwd: false
    51  #  passwd: $5$hkui88$nvZgIle31cNpryjRfO9uArF7DYiBcWEnjqq7L1AQNN3
    52  
    53  ## Update apt database and upgrade packages on first boot
    54  #package_update: true
    55  #package_upgrade: true
    56  
    57  ## Install additional packages on first boot
    58  #packages:
    59  #- pwgen
    60  #- pastebinit
    61  #- [libpython2.7, 2.7.3-0ubuntu3.1]
    62  
    63  ## Write arbitrary files to the file-system (including binaries!)
    64  #write_files:
    65  #- path: /etc/default/keyboard
    66  #  content: |
    67  #    # KEYBOARD configuration file
    68  #    # Consult the keyboard(5) manual page.
    69  #    XKBMODEL="pc105"
    70  #    XKBLAYOUT="gb"
    71  #    XKBVARIANT=""
    72  #    XKBOPTIONS="ctrl: nocaps"
    73  #  permissions: '0644'
    74  #  owner: root:root
    75  #- encoding: gzip
    76  #  path: /usr/bin/hello
    77  #  content: !!binary |
    78  #    H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
    79  #  owner: root:root
    80  #  permissions: '0755'
    81  
    82  ## Run arbitrary commands at rc.local like time
    83  #runcmd:
    84  #- [ ls, -l, / ]
    85  #- [ sh, -xc, "echo $(date) ': hello world!'" ]
    86  #- [ wget, "http://ubuntu.com", -O, /run/mydir/index.html ]