Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Fix creation of new entries #14

Closed
raphink opened this issue Sep 9, 2015 · 2 comments
Closed

Fix creation of new entries #14

raphink opened this issue Sep 9, 2015 · 2 comments
Labels
bug Something isn't working

Comments

@raphink
Copy link
Member

raphink commented Sep 9, 2015

4a9d55a introduced a new tree for the lens, which types every setting.

The manifests were fixed accordingly, but non-existing entries can not be created anymore.

For example, when passing:

puppetserver::config::helper { 'webserver/port':
      setting => 'webserver.conf/@hash[.="webserver"]/@simple[.="port"]',
      type    => 'puppetserver',
}

it will fail if there is no entry for port yet.

The solution is to create each level with Augeas, e.g. in this case:

$changes = [
  'set webserver.conf/@hash[.="webserver"] "webserver"',
  'set webserver.conf/@hash[.="webserver"]/@simple[.="port"] "port"',
  "set webserver.conf/@hash[.="webserver"]/@simple[.="port"]/@value '#{value}'",
]

And if we're going to do that, we might as well revert to the old interface, and add a type parameter.

@raphink raphink added the bug Something isn't working label Sep 9, 2015
@raphink
Copy link
Member Author

raphink commented Sep 10, 2015

So now we have a puppetserver_config type and provider, we "just" need to wire it properly to the manifests so that it works in a transparent way :-)

@raphink
Copy link
Member Author

raphink commented Sep 14, 2015

Fixed in 2.0.0

@raphink raphink closed this as completed Sep 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant