Cannot run script once with heat+cloud-init

asked 2016-03-02 03:04:17 -0500

esierrap gravatar image

My heat template looks like this (only cloud init área):

   ...
   cloud_init_was_8_5_5:
            type: "OS::Heat::CloudConfig"
            properties:
                    cloud_config:
                            package_update: true
                            package_upgrade: true
                            groups:
                            - bks
                            - browser
                            - wasadm
                            - uprftuniadm
                            - sopbksadm
                            - confbksadm
                            - gescambadm
                            - gcontent
                            users:
                            - name: websphere
                              gecos: websphere user
                              groups: bks,uprftuniadm
                              passwd: '$1$N1b4KDEf$ClZRzc9Pr59TDJXB6Yuru0'
                              shell: /sbin/nologin
                            - name: sopbks
                              gecos: sopbks user
                              groups: bks,websphere,wasadm
                              passwd: '$1$N1b4KDEf$ClZRzc9Pr59TDJXB6Yuru0'
                              shell: /sbin/nologin
                            - name: uprftuni
                              gecos: uprftuni user
                              groups: bks,websphere,wasadm
                              passwd: '$1$N1b4KDEf$ClZRzc9Pr59TDJXB6Yuru0'
                              shell: /sbin/nologin
                            - name: gescamb
                              gecos: gescamb user
                              groups: bks,websphere
                              passwd: '$1$N1b4KDEf$ClZRzc9Pr59TDJXB6Yuru0'
                              shell: /sbin/nologin
                            - name: admcm
                              primary_group: bks
                              gecos: admcm user
                              passwd: '$1$N1b4KDEf$ClZRzc9Pr59TDJXB6Yuru0'
                              shell: /sbin/nologin
                            write_files:
                            - content: |
                                    #!/bin/bash
                                    touch /root/test.txt
                              path: /var/lib/cloud/scripts/per-once/prueba.sh
                              permissions: '0755'
                              owner: root:root
                            output: {all: '| tee -a /var/log/cloud-init-output.log'}

When i log on to the instance, test.txt doesn`t exist in /root directory, am i missing something?

On the other hand, cloud-init.log has no info, it's empty and i don't understand why.

Any help is welcome, thanks in advance.

edit retag flag offensive close merge delete