hercules-team/augeasproviders — pull request #60 by raphink (2014-06-11 20:17:30+00:00)
Title: Rsyslog manage remote hostname entry: can't set port with ":" delimiter alongside hostname

I'm trying to set the port along side the hostname for "remote server" as seen below. This is how it should appear in /etc/rsyslog.conf. This isn't working. Not sure if there is an attribute for the port number i can use, but i'm assuming strange characters as ":" and such aren't supported in this attribute.

### the block

```puppet
syslog { "cortez_test":
ensure => present,
facility => "*",
level => "*",
action_type => "hostname",
action => "testserver:514",
provider => "rsyslog",
}
```

### the results

```puppet
[root@tstctlvopenpt04 test]# puppet apply /root/test/init.pp
Notice: Compiled catalog for tstctlvopenpt04.iteclientsys.local in environment production in 0.05 seconds
Error: Could not set 'present' on ensure: /augeas/files/etc/rsyslog.conf/error/path = /files/etc/rsyslog.conf/entry/action
/augeas/files/etc/rsyslog.conf/error/lens = /usr/share/augeas/lenses/dist/rsyslog.aug:41.16-.39:
/augeas/files/etc/rsyslog.conf/error/message = Failed to match
{ /no_sync/ }?{ /file/ = /\/[^\001-\004\t\n ]+/ } | { /hostname/ = /[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?(\\.[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?)*/ }({ /port/ = /[0-9]+/ })? | { /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /user/ = /\\*/ } | { /program/ = /[^\001-\004\t\n ][^\001-\004\n]+[^\001-\004\t\n ]/ } | { /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /omusrmsg/ = /\\*/ }
with tree
{ "hostname" = "testserver:514" } at 10:/root/test/init.pp
Error: Could not set 'present' on ensure: /augeas/files/etc/rsyslog.conf/error/path = /files/etc/rsyslog.conf/entry/action
/augeas/files/etc/rsyslog.conf/error/lens = /usr/share/augeas/lenses/dist/rsyslog.aug:41.16-.39:
/augeas/files/etc/rsyslog.conf/error/message = Failed to match
{ /no_sync/ }?{ /file/ = /\/[^\001-\004\t\n ]+/ } | { /hostname/ = /[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?(\\.[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?)*/ }({ /port/ = /[0-9]+/ })? | { /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /user/ = /\\*/ } | { /program/ = /[^\001-\004\t\n ][^\001-\004\n]+[^\001-\004\t\n ]/ } | { /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /omusrmsg/ = /\\*/ }
with tree
{ "hostname" = "testserver:514" } at 10:/root/test/init.pp
Wrapped exception:
/augeas/files/etc/rsyslog.conf/error/path = /files/etc/rsyslog.conf/entry/action
/augeas/files/etc/rsyslog.conf/error/lens = /usr/share/augeas/lenses/dist/rsyslog.aug:41.16-.39:
/augeas/files/etc/rsyslog.conf/error/message = Failed to match
{ /no_sync/ }?{ /file/ = /\/[^\001-\004\t\n ]+/ } | { /hostname/ = /[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?(\\.[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?)*/ }({ /port/ = /[0-9]+/ })? | { /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /user/ = /\\*/ } | { /program/ = /[^\001-\004\t\n ][^\001-\004\n]+[^\001-\004\t\n ]/ } | { /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /omusrmsg/ = /\\*/ }
with tree
{ "hostname" = "testserver:514" }
Error: /Stage[main]//Syslog[cortez_test]/ensure: change from absent to present failed: Could not set 'present' on ensure: /augeas/files/etc/rsyslog.conf/error/path = /files/etc/rsyslog.conf/entry/action
/augeas/files/etc/rsyslog.conf/error/lens = /usr/share/augeas/lenses/dist/rsyslog.aug:41.16-.39:
/augeas/files/etc/rsyslog.conf/error/message = Failed to match
{ /no_sync/ }?{ /file/ = /\/[^\001-\004\t\n ]+/ } | { /hostname/ = /[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?(\\.[0-9A-Za-z]([0-9A-Za-z-]*[0-9A-Za-z])?)*/ }({ /port/ = /[0-9]+/ })? | { /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /user/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /user/ = /\\*/ } | { /program/ = /[^\001-\004\t\n ][^\001-\004\n]+[^\001-\004\t\n ]/ } | { /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ }({ /omusrmsg/ = /[0-9A-Za-z][.0-9A-Z_a-z-]*/ })* | { /omusrmsg/ = /\\*/ }
with tree
{ "hostname" = "testserver:514" } at 10:/root/test/init.pp
Notice: Finished catalog run in 0.12 seconds
```