I've decided to not be blocked by this issue and to have puppet manage the 
config file.  It's not an ideal solution, but good enough until I learn 
more about either augeas or inifile.

Greg

On Monday, September 23, 2013 3:48:05 PM UTC-7, Greg Coit wrote:
>
> Nathan,
>
> Thanks for the response - I did not know about inifile.
>
> I unfortunately seem to be having trouble with ini_setting - the following 
> causes a new line to be added every time puppet gets run:
>
>   ini_setting { 'anonymous_enable':
>     path    => '/etc/vsftpd/vsftpd.conf',
>     setting => 'anonymous_enable',
>     value   => 'NO',
>     ensure  => present,
>   }
>
>   ini_setting { 'chroot_local_user':
>     path    => '/etc/vsftpd/vsftpd.conf',
>     setting => 'chroot_local_user',
>     value   => 'YES',
>     ensure  => present,
>   }
>
> BTW, still playing with augeas too - the most recent code is:
>
>   augeas { 'vsftpd.conf':
>     context   => '/files/vsftpd/vsftpd.conf',
>     incl      => '/etc/vsftpd/vsftpd.conf',
>     load_path => '/usr/share/augeas/lenses/dist/',
>     lens      => 'vsftpd',
>     changes   => [ 'set anonymous_enable NO', 'set chroot_local_user YES', 
> ],
>   }
>
> Turns out that augeas has an unwelcome behavior - it tries to load all 
> files that match the lens - if any are non-standard, it errors out.  
>
> Greg
>
> On Monday, September 23, 2013 3:00:36 PM UTC-7, Nathan Valentine wrote:
>>
>> Greg, 
>>
>> I believe resource ini_setting would be appropriate here but I do 
>> understand the desire to learn about Puppet + Augeas. 
>>
>> >   augeas { 'vsftpd.conf':
>> >     context => '/etc/vsftpd/vsftpd.conf',
>> >     changes => [ 'set anonymous_enable=NO', 'set 
>> chroot_local_user=YES', ],
>> >     require => File['/etc/vsftpd/vsftpd.conf'],
>> >   }
>>
>>
>>     context => '*/files*/vsftpd/vsftpd.conf',
>>
>> ?
>>
>> I'm lazy and haven't tested with a Puppet apply but I think this might 
>> just be an issue of understanding the namespace-y Augeas stuff. You can 
>> test like so with augtool:
>>
>> $ augtool ls */files*/vsftpd/vsftpd.conf
>>
>> -- 
>> ---
>> Nathan Valentine - [email protected]
>> Puppet Labs Professional Services
>> GV: 415.504.2173
>> Skype: nrvale0
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to