~alpine/users

2 2

alpine linux v3.18 + pxe (ram live) + cloud-init (tiny-cloud) = install

Details
Message ID
<882df88f-5d10-9e6f-a3e5-d529d9b99eec@yandex.ru>
DKIM signature
missing
Download raw message
Hi!

How can I make it so that cloud-init is executed on pxe boot? Here is my 
file structure and settings:

pxe config:

```
label alpine-with-scipt
     menu label Alpine with my script
     kernel alpine-installer/boot/vmlinuz-lts
     initrd alpine-installer/boot/initramfs-lts
     append modules=loop,squashfs,sd-mod,usb-storage 
modloop=http://10.10.10.10/alpine-installer/boot/modloop-lts 
alpine_repo=alpine_repo=http://dl-cdn.alpinelinux.org/alpine/latest-stable/main 
ssh_key=http://10.10.10.10/soft/authorized_keys ip=dhcp 
apkovl=http://10.10.10.10/cloud-init/tmp/alpine-test-01.tar.gz
```

I added 
ds=nocloud-net;s=http://10.10.10.10/cloud-init/tmp/var/lib/cloud, but it 
didn't work

`alpine-test-01.tar.gz`:

tree structure:

```
.
├── etc
│   ├── apk
│   │   └── world
│   ├── cloud
│   │   └── cloud.cfg
│   ├── init.d
│   │   └── local.stop
│   ├── network
│   │   └── interfaces
│   ├── runlevels
│   │   └── default
│   │       └── local.stop -> /etc/init.d/local.stop
│   └── tiny-cloud.conf
└── var
     └── lib
         └── cloud
             └── user-data
```

`./etc/apk/world`:

```
tiny-cloud
tiny-cloud-alpine
tiny-cloud-openrc
tiny-cloud-nocloud
tiny-cloud-network
nano
htop

# https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud#requirements
e2fsprogs-extra
openssh-server
partx
sfdisk
yx
```

`./etc/init.d/local.stop`:

```
#!/sbin/openrc-run

start () {
tiny-cloud --enable
}
```

`./etc/network/interfaces`:

```
iface eth0 inet dhcp
     udhcpc_opts -O search
```

`./etc/tiny-cloud.conf`:

```
# Tiny Cloud configuration
# /etc/tiny-cloud.conf

# REQUIRED: The instance's cloud provider
# valid: aws, azure, gcp, oci, nocloud
CLOUD=nocloud

TINY_CLOUD_LOGS=/var/log
```

`./var/lib/cloud/user-data`:

```
#cloud-config

cloud_final_modules:
   - rightscale_userdata
   - scripts-per-once
   - scripts-per-boot
   - scripts-per-instance
   - scripts-user
   - keys-to-console
   - phone-home
   - final-message
   - always

packages:
   install:
   - mc

#autoinstall:
# user-data:
write_files:
       - path: /etc/22222222222
         content: |
           qweasdzxcqweasdzxc
runcmd:
   - touch /etc/runcmd_$(date)

chpasswd:
   list: |
      root:myrootpassword
      cloud-user:mypassword
   expire: False
```
Details
Message ID
<20231109165122.1cccacad@ncopa-desktop.lan>
In-Reply-To
<882df88f-5d10-9e6f-a3e5-d529d9b99eec@yandex.ru> (view parent)
DKIM signature
missing
Download raw message
On Thu, 9 Nov 2023 16:34:03 +0300
don Rumata <don-rumata-vrn@yandex.ru> wrote:

> Hi!
> 
> How can I make it so that cloud-init is executed on pxe boot? Here is my 
> file structure and settings:

FYI, there are cloud-init and tiny-cloud. It looks like you are trying
to use tiny-cloud. doing that from pxe boot is currently not supported,
but should be relatively easy to fix.

Could you please add an issue to
https://gitlab.alpinelinux.org/alpine/mkinitfs/-/issues

I think we can make this work without needing any apkovl, we simply
need to make the initramfs enable tiny-cloud when it finds `ds=...`,
similar to what we do when it finds cidata disk label.

Thanks!
-nc
> 
> pxe config:
> 
> ```
> label alpine-with-scipt
>      menu label Alpine with my script
>      kernel alpine-installer/boot/vmlinuz-lts
>      initrd alpine-installer/boot/initramfs-lts
>      append modules=loop,squashfs,sd-mod,usb-storage 
> modloop=http://10.10.10.10/alpine-installer/boot/modloop-lts 
> alpine_repo=alpine_repo=http://dl-cdn.alpinelinux.org/alpine/latest-stable/main 
> ssh_key=http://10.10.10.10/soft/authorized_keys ip=dhcp 
> apkovl=http://10.10.10.10/cloud-init/tmp/alpine-test-01.tar.gz
> ```
> 
> I added 
> ds=nocloud-net;s=http://10.10.10.10/cloud-init/tmp/var/lib/cloud, but
> it didn't work
> 
> `alpine-test-01.tar.gz`:
> 
> tree structure:
> 
> ```
> .
> *** etc
> *   *** apk
> *   *   *** world
> *   *** cloud
> *   *   *** cloud.cfg
> *   *** init.d
> *   *   *** local.stop
> *   *** network
> *   *   *** interfaces
> *   *** runlevels
> *   *   *** default
> *   *       *** local.stop -> /etc/init.d/local.stop
> *   *** tiny-cloud.conf
> *** var
>      *** lib
>          *** cloud
>              *** user-data
> ```
> 
> `./etc/apk/world`:
> 
> ```
> tiny-cloud
> tiny-cloud-alpine
> tiny-cloud-openrc
> tiny-cloud-nocloud
> tiny-cloud-network
> nano
> htop
> 
> # https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud#requirements
> e2fsprogs-extra
> openssh-server
> partx
> sfdisk
> yx
> ```
> 
> `./etc/init.d/local.stop`:
> 
> ```
> #!/sbin/openrc-run
> 
> start () {
> tiny-cloud --enable
> }
> ```
> 
> `./etc/network/interfaces`:
> 
> ```
> iface eth0 inet dhcp
>      udhcpc_opts -O search
> ```
> 
> `./etc/tiny-cloud.conf`:
> 
> ```
> # Tiny Cloud configuration
> # /etc/tiny-cloud.conf
> 
> # REQUIRED: The instance's cloud provider
> # valid: aws, azure, gcp, oci, nocloud
> CLOUD=nocloud
> 
> TINY_CLOUD_LOGS=/var/log
> ```
> 
> `./var/lib/cloud/user-data`:
> 
> ```
> #cloud-config
> 
> cloud_final_modules:
>    - rightscale_userdata
>    - scripts-per-once
>    - scripts-per-boot
>    - scripts-per-instance
>    - scripts-user
>    - keys-to-console
>    - phone-home
>    - final-message
>    - always
> 
> packages:
>    install:
>    - mc
> 
> #autoinstall:
> # user-data:
> write_files:
>        - path: /etc/22222222222
>          content: |
>            qweasdzxcqweasdzxc
> runcmd:
>    - touch /etc/runcmd_$(date)
> 
> chpasswd:
>    list: |
>       root:myrootpassword
>       cloud-user:mypassword
>    expire: False
> ```
> 
Details
Message ID
<911b6c73-b7e9-a096-ca29-7d0b55f2f2fd@yandex.ru>
In-Reply-To
<20231109165122.1cccacad@ncopa-desktop.lan> (view parent)
DKIM signature
missing
Download raw message
Done: https://gitlab.alpinelinux.org/alpine/mkinitfs/-/issues/49

09.11.2023 18:51, Natanael Copa пишет:
> On Thu, 9 Nov 2023 16:34:03 +0300
> don Rumata <don-rumata-vrn@yandex.ru> wrote:
>
>> Hi!
>>
>> How can I make it so that cloud-init is executed on pxe boot? Here is my
>> file structure and settings:
> FYI, there are cloud-init and tiny-cloud. It looks like you are trying
> to use tiny-cloud. doing that from pxe boot is currently not supported,
> but should be relatively easy to fix.
>
> Could you please add an issue to
> https://gitlab.alpinelinux.org/alpine/mkinitfs/-/issues
>
> I think we can make this work without needing any apkovl, we simply
> need to make the initramfs enable tiny-cloud when it finds `ds=...`,
> similar to what we do when it finds cidata disk label.
>
> Thanks!
> -nc
>> pxe config:
>>
>> ```
>> label alpine-with-scipt
>>       menu label Alpine with my script
>>       kernel alpine-installer/boot/vmlinuz-lts
>>       initrd alpine-installer/boot/initramfs-lts
>>       append modules=loop,squashfs,sd-mod,usb-storage
>> modloop=http://10.10.10.10/alpine-installer/boot/modloop-lts
>> alpine_repo=alpine_repo=http://dl-cdn.alpinelinux.org/alpine/latest-stable/main
>> ssh_key=http://10.10.10.10/soft/authorized_keys ip=dhcp
>> apkovl=http://10.10.10.10/cloud-init/tmp/alpine-test-01.tar.gz
>> ```
>>
>> I added
>> ds=nocloud-net;s=http://10.10.10.10/cloud-init/tmp/var/lib/cloud, but
>> it didn't work
>>
>> `alpine-test-01.tar.gz`:
>>
>> tree structure:
>>
>> ```
>> .
>> *** etc
>> *   *** apk
>> *   *   *** world
>> *   *** cloud
>> *   *   *** cloud.cfg
>> *   *** init.d
>> *   *   *** local.stop
>> *   *** network
>> *   *   *** interfaces
>> *   *** runlevels
>> *   *   *** default
>> *   *       *** local.stop -> /etc/init.d/local.stop
>> *   *** tiny-cloud.conf
>> *** var
>>       *** lib
>>           *** cloud
>>               *** user-data
>> ```
>>
>> `./etc/apk/world`:
>>
>> ```
>> tiny-cloud
>> tiny-cloud-alpine
>> tiny-cloud-openrc
>> tiny-cloud-nocloud
>> tiny-cloud-network
>> nano
>> htop
>>
>> # https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud#requirements
>> e2fsprogs-extra
>> openssh-server
>> partx
>> sfdisk
>> yx
>> ```
>>
>> `./etc/init.d/local.stop`:
>>
>> ```
>> #!/sbin/openrc-run
>>
>> start () {
>> tiny-cloud --enable
>> }
>> ```
>>
>> `./etc/network/interfaces`:
>>
>> ```
>> iface eth0 inet dhcp
>>       udhcpc_opts -O search
>> ```
>>
>> `./etc/tiny-cloud.conf`:
>>
>> ```
>> # Tiny Cloud configuration
>> # /etc/tiny-cloud.conf
>>
>> # REQUIRED: The instance's cloud provider
>> # valid: aws, azure, gcp, oci, nocloud
>> CLOUD=nocloud
>>
>> TINY_CLOUD_LOGS=/var/log
>> ```
>>
>> `./var/lib/cloud/user-data`:
>>
>> ```
>> #cloud-config
>>
>> cloud_final_modules:
>>     - rightscale_userdata
>>     - scripts-per-once
>>     - scripts-per-boot
>>     - scripts-per-instance
>>     - scripts-user
>>     - keys-to-console
>>     - phone-home
>>     - final-message
>>     - always
>>
>> packages:
>>     install:
>>     - mc
>>
>> #autoinstall:
>> # user-data:
>> write_files:
>>         - path: /etc/22222222222
>>           content: |
>>             qweasdzxcqweasdzxc
>> runcmd:
>>     - touch /etc/runcmd_$(date)
>>
>> chpasswd:
>>     list: |
>>        root:myrootpassword
>>        cloud-user:mypassword
>>     expire: False
>> ```
>>
Reply to thread Export thread (mbox)