Package resource with install_options is not working as expected

177 views
Skip to first unread message

alexandra kisin

unread,
Mar 30, 2020, 2:07:54 PM3/30/20
to Puppet Users
Hello,
Trying to create manifest with package resource for debian package and want to use insstallation option --force-confnew.
The manifest is :
package { 'my_package_name':
                name => 'my_package_name',
                ensure => present,
                install_options => ['-o Dpkg::Options::="--force-confnew"'],
            }

When run this module on the client get an error :
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold "-o Dpkg::Options::=\"--force-confnew\"" install my_package_name' returned 100: E: Invalid operation "-o Dpkg::Options::=\"--force-confnew\""
Error: /Stage[main]/Vnc/Package[my_package_name]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold "-o Dpkg::Options::=\"--force-confnew\"" install my_package_name' returned 100: E: Invalid operation "-o Dpkg::Options::=\"--force-confnew\"" (corrective)

If exactly the same command I run from terminal of the client -  it is working properly and the package successfully installed.

Thank you.

Gabriel Nagy

unread,
Mar 30, 2020, 2:38:16 PM3/30/20
to Puppet Users
 Hi,

There's a special parameter for what you're trying to do, so you don't have to use install_options.

To pass --force-confnew to the resource you need to set configfiles => 'replace' in the manifest.


Hope that helps,
Gabriel

alexandra kisin

unread,
Mar 30, 2020, 4:04:35 PM3/30/20
to Puppet Users
Thank you so much!
I used the configfiles like you suggested and everything is working perfect now.
Thank you !

понедельник, 30 марта 2020 г., 17:38:16 UTC+3 пользователь Gabriel Nagy написал:

alexandra kisin

unread,
Mar 30, 2020, 4:52:53 PM3/30/20
to Puppet Users

Thank you so much!
I used the configfiles like you suggested and everything is working perfectly.
Thank you again !


понедельник, 30 марта 2020 г., 17:38:16 UTC+3 пользователь Gabriel Nagy написал:
 Hi,
Reply all
Reply to author
Forward
0 new messages