Ask Your Question
1

get_file in cloud_config runcmd

asked 2017-04-04 04:25:41 -0500

AB239 gravatar image

Hello,

I want to know if we can use get_file to fetch a file with cloud_config's runcmd command?

For example, can this:

  run_cloud_config:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        runcmd:
        - sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
        - sed -i -e '$aPasswordAuthentication yes' /etc/ssh/sshd_config
        - restart ssh

be written as or something similar so that I could fetch the set of command from external source rather than keeping them in template:

  run_cloud_config:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        runcmd:
        - content: {get_file: <path to file>}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-09-05 18:23:00 -0500

I tried the following:

base_config:
type: OS::Heat::CloudConfig
properties:
  cloud_config:
    runcmd: { get_file: <path/to/file> }

That did not work. Looking at the cloud-init logs, seems like the way the data is passed in, runcmd was trying to run each character of the file one at a time.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-04-04 04:25:41 -0500

Seen: 118 times

Last updated: Apr 04 '17