2016-06-21 16 views
1

Ich versuche, eine coreos Instanz auf Google Cloud zu erstellen und es scheint, meine Cloud-configgcloud CoreOs Cloud-Config nicht Wirkung

hier ist mein Terminal-Befehl zum Einrichten der gcloud coreos Instanz zu ignorieren.

Ich habe unter einem Beispiel meiner Cloud-Konfiguration.

#cloud-config 
     coreos: 
     units: 
      - name: sample.service 
      command: start 
      enable: true 
      content: | 
       [Unit] 
       Description=Sample Service. 
       After=docker.service 
       Requires=docker.service 

       [Service] 
       TimeoutStartSec=0 
       EnvironmentFile=/etc/environment 
       ExecStart=/opt/bin/docker-compose start; 
       ExecStop=/opt/bin/docker-compose stop; 

       [Install] 
       WantedBy=multi-user.target 
      - name: backup.service 
      enable: true 
      content: | 
       [Unit] 
       Description=Sample BackUp Script 

       [Service] 
       Type=oneshot 
       ExecStart=/usr/bin/docker exec db-live /backup-db.sh 
      - name: backup.timer 
      command: start 
      enable: true 
      content: | 
       [Unit] 
       Description=Runs Sample BackUp twice a day 

       [Timer] 
       OnCalendar=*-*-* 0/12:00:00 
       # References for timers https://www.freedesktop.org/software/systemd/man/systemd.time.html# units: 
      - name: media-backup.mount 
      command: start 
      enable: true 
      content: | 
       [Mount] 
       What=/dev/disk/by-id/google-core-disk-1 
       Where=/app 
       Type=ext3 
     write_files: 
     - path: /etc/environment 
      permissions: 420 
      content: | 
      COMPOSE_FILE=/path/to/app/docker-compose.yml 
     - path: /home/core/.bashrc 
      permissions: 420 
      owner: core:core 
      content: | 
      # source <(sudo cat /etc/environment) 
      eval $(sudo cat /etc/environment | sed 's/^/export /') 

Antwort

0

Cloud-configs verwenden Einzug für Struktur/Hierarchie und die Datei, die Sie freigegeben haben, ist falsch vorgesehen. War das ein Tippfehler zum Teilen oder ist es tatsächlich so?

Testen Sie https://coreos.com/validate/, um herauszufinden, ob Ihre Konfiguration gültig ist oder nicht.