Rabadash8820 / AwsUtil

A set of scripts, templates, and schemas for general AWS cloud infrastructures.
Mozilla Public License 2.0
2 stars 0 forks source link

Use sed to Change Configuration Files in cfn-init Again #32

Closed Rabadash8820 closed 7 years ago

Rabadash8820 commented 7 years ago

While we were leaning towards specifying the entire contents of configuration files in the files property of cfn-init configs, this just doesn't seem like a realistic solution, for the following reasons:

Long story short, instead of defining config file contents in the files property, we should be using the following pattern:

files:
  /etc/danware/derp.sed
    content: !Sub |
      s|oldValue1|newValue1|
      s|oldValue2|newValue2|
      ...
commands:
  modifyConfig:
    command:
      sed --file /etc/danware/derp.sed --in-place /etc/path/to/program.conf
      service program restart
services:
  program:
    enabled: true
    ensureRunning: true
Rabadash8820 commented 7 years ago

Issue didn't close due to that stupid GitHub force push error... Closing now.