Outils pour utilisateurs

Outils du site


tech:notes_cloudinit

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

tech:notes_cloudinit [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:notes_cloudinit [2025/03/26 10:04] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 {{tag>Brouillon}} {{tag>Brouillon}}
  
-Notes cloudinit+Notes cloudinit
  
 Voir : Voir :
Ligne 11: Ligne 12:
 * Tiny Cloud * Tiny Cloud
  
-<code ->+~~~
 ubuntu@vm-testjb1:~$ curl 169.254.169.254/1.0/meta-data/public-keys/0/openssh-key ubuntu@vm-testjb1:~$ curl 169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCZQwNs9aV//oN/N/NmbVqL83ahLatiVccLR1w2YEVBGX2fj5ANnj7a7hNk1tyld+CQlP93I6z7CW9bBxUjwwcxYWeVmBVRBLtFnjhN56gL7jGfXy6uwtUAf84tKWRem10tThIZhjWIIMHfDyFT7vVVN/hk9E3tQ7CejHK3NzhBUjDzrQ8yVIRynveNe93KNlCHW8T0rD83vqmEwApep/EuGD4rwb1e4zYAeh0HXVQIQzaoXlz8OwEBgzkvygCRrtUJcn3bQIloBmu2KrDvPskhqgCU4I9sbkN/K9PLn5hJVmhHVT3Prf0eU8hbrzdnfXlczmLbmVYTqUlOIvrvbAT jibe@vmdeb1ubuntu@vm-testjb1:~$ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCZQwNs9aV//oN/N/NmbVqL83ahLatiVccLR1w2YEVBGX2fj5ANnj7a7hNk1tyld+CQlP93I6z7CW9bBxUjwwcxYWeVmBVRBLtFnjhN56gL7jGfXy6uwtUAf84tKWRem10tThIZhjWIIMHfDyFT7vVVN/hk9E3tQ7CejHK3NzhBUjDzrQ8yVIRynveNe93KNlCHW8T0rD83vqmEwApep/EuGD4rwb1e4zYAeh0HXVQIQzaoXlz8OwEBgzkvygCRrtUJcn3bQIloBmu2KrDvPskhqgCU4I9sbkN/K9PLn5hJVmhHVT3Prf0eU8hbrzdnfXlczmLbmVYTqUlOIvrvbAT jibe@vmdeb1ubuntu@vm-testjb1:~$
-</code>+~~~
  
-<code yaml>+~~~yaml
 #cloud-config #cloud-config
 packages: packages:
Ligne 30: Ligne 31:
  
 output: {all: '| tee -a /var/log/cloud-init-output.log'} output: {all: '| tee -a /var/log/cloud-init-output.log'}
-</code>+~~~
  
-<code ->+~~~
 ************************************************************************** **************************************************************************
 # This system is using the EC2 Metadata Service, but does not appear to  # # This system is using the EC2 Metadata Service, but does not appear to  #
Ligne 64: Ligne 65:
 or or
   touch /var/lib/cloud/instance/warnings/.skip   touch /var/lib/cloud/instance/warnings/.skip
-</code>+~~~
  
-== DRAFT - Se connecter à une instance dont on ne possède pas la clef+ 
 +## DRAFT - Se connecter à une instance dont on ne possède pas la clef
  
 Voir :  Voir : 
Ligne 73: Ligne 75:
 FIXME FIXME
  
-<code bash>+~~~bash
 aws --region=eu-central-1 ec2 describe-instances --output=table aws --region=eu-central-1 ec2 describe-instances --output=table
-</code>+~~~
  
-  +''my_script.sh'' 
-<code bash my_script.sh>+~~~bash
 #!/bin/bash #!/bin/bash
 cat >> /home/ec2-user/.ssh/authorized_keys <<EOF cat >> /home/ec2-user/.ssh/authorized_keys <<EOF
Ligne 86: Ligne 88:
 sed -i 's/^PasswordAuthentication/#&/' /etc/ssh/sshd_config sed -i 's/^PasswordAuthentication/#&/' /etc/ssh/sshd_config
 systemctl restart sshd systemctl restart sshd
-</code>+~~~
  
-<code bash>+~~~bash
 base64 my_script.sh > my_script_base64.txt base64 my_script.sh > my_script_base64.txt
-</code>+~~~
  
  
-<code bash>+~~~bash
 aws ec2 --region=eu-central-1 modify-instance-attribute --instance-id i-08df328706b9e6d46 --attribute userData --value file://my_script_base64.txt aws ec2 --region=eu-central-1 modify-instance-attribute --instance-id i-08df328706b9e6d46 --attribute userData --value file://my_script_base64.txt
-</code>+~~~
  
-== Autres+ 
 +## Autres
  
 /var/lib/cloud/data/set-hostname /var/lib/cloud/data/set-hostname
Ligne 105: Ligne 108:
  
 Kernel Kernel
-<code ini>+~~~ini
 cloud-init=disabled cloud-init=disabled
-</code>+~~~ 
  
-== Pb+## Pb
  
-=== Pb temps de démarrage élevé+### Pb temps de démarrage élevé
  
-<code ->+~~~
 # systemd-analyze # systemd-analyze
 Startup finished in 3.195s (kernel) + 23.788s (userspace) = 26.983s Startup finished in 3.195s (kernel) + 23.788s (userspace) = 26.983s
Ligne 130: Ligne 134:
            946ms bind9.service            946ms bind9.service
            911ms dev-mapper-vgos\x2droot            911ms dev-mapper-vgos\x2droot
-</code>+~~~
  
 Logs  Logs 
Ligne 136: Ligne 140:
 * /var/log/cloud-init-output.log * /var/log/cloud-init-output.log
  
-<code bash>+~~~bash
 curl http://169.254.169.254/openstack/2018-08-27/meta_data.json curl http://169.254.169.254/openstack/2018-08-27/meta_data.json
-</code>+~~~
  
-==== Solution+#### Solution
  
-<code bash>+~~~bash
 dpkg -i cloud-init_20.2-2~deb10u1_all.deb cloud-guest-utils_0.29-1_all.deb dpkg -i cloud-init_20.2-2~deb10u1_all.deb cloud-guest-utils_0.29-1_all.deb
  
 echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
 rm /etc/network/interfaces.d/50-cloud-init.cfg rm /etc/network/interfaces.d/50-cloud-init.cfg
-</code>+~~~
  
    
tech/notes_cloudinit.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki