Comments (21)
Pardon the slow response; I just discovered that I wasn't watching a bunch of my own repositories. I'll be reviewing this shortly. Thanks!
from puppet-alternatives.
I could actually do this quickly and send you a pull request if you want but I was super busy at the time so just threw up a bug here in case someone got to it first.. up to you!
from puppet-alternatives.
I'm looking at the man page for update-alternatives and I don't know how this behavior would interact with the current interface. How would you want to use this resource to install alternatives? Could you add some example cases?
from puppet-alternatives.
Well before you can set
an alternative it must be first installed
if it's not already.
So in current form your module allows someone to switch between the various system installed alternatives.
I would honestly think that any time someone wants to set set
you should just install
it for them if it's not already..
My example in my first message earlier shows how I used exec{} to install it if it's not already installed.
So let's say I want to update hadoop-conf (which is /etc/hadoop/conf) to use /etc/hadoop/conf.mine instead of the default /etc/hadoop/conf.empty:
alt=hadoop-conf
mine=/etc/hadoop/conf.mine
path=/etc/hadoop/conf
priority=50
# if it's not already installed
update-alternatives --list $alt | grep -q $mine ||
# install it
update-alternatives --verbose --install $path $alt $mine $priority
from puppet-alternatives.
So to be sure I understand you, the update-alternatives --install
option will both install the link as an alternative and set it as the active alternative?
from puppet-alternatives.
Actually you must first install
before you can set
.
Which is why above I use Exec -> alternative
since you still need to perform a set
afterwards.
from puppet-alternatives.
Since there are use cases for installing an alternative that don't involve actually forcibly setting one, I can see a case for making this a separate type. They should be easy enough to chain together.
from puppet-alternatives.
@chino sorry about the delay in responding to this; I haven't had a lot of time to work on my modules.
I've prototyped a type interface at https://github.com/adrienthebo/puppet-alternatives/blob/0622f1e577c86ecf5ca1a32035f007e959d1b8ca/lib/puppet/type/alternative_entry.rb ; could you take a look and let me know if that will suit your needs?
My concern is that right now the alternative link is disconnected from the actual alternative, so /bin/false
could be used as an alternative for www-browser
but there's no immediate way to tie the two together. Trying to make this might mean using multiple namevars, which is a gigantic bag of worms that I don't know if I want to get into.
from puppet-alternatives.
I would like to see Redhat support added to 0622f1e
from puppet-alternatives.
@adrienthebo Works for me. Although I had to make some changes (@property_hash[:key] to @resource.value(:key) in alternative_entry/dpkg.rb).
from puppet-alternatives.
sorry it works not for me on debian wheezy and puppet 3.4.2
I try that:
alternative_entry { '/bin/nano':
ensure => absent,
}
This error came on client:
Debug: Executing '/usr/sbin/update-alternatives --list '
Error: /Stage[main]/Debian/Alternative_entry[/bin/nano]: Could not evaluate: Execution of '/usr/sbin/update-alternatives --list ' returned 2: update-alternatives: error: /var/lib/dpkg/alternatives/ corrupt: while reading status: Is a directory
from puppet-alternatives.
@lgbff could you try isolating whats happening that's causing that corruption? Could you see what commands are being run by Puppet and if they are doing what's expected?
from puppet-alternatives.
Hmm, i run on client:
#puppet agent -vd -t
and the error is:
Debug: Executing '/usr/sbin/update-alternatives --list '
Error: /Stage[main]/Debian/Alternative_entry[/bin/nano]: Could not evaluate: Execution of '/usr/sbin/update-alternatives --list ' returned 2: update-alternatives: error: /var/lib/dpkg/alternatives/ corrupt: while reading status: Is a directory
what can i try for more debugging?
from puppet-alternatives.
any ideas?
from puppet-alternatives.
@lgbff it seems like the commands being used by the provider aren't doing what's expected, could you do some testing around what is the correct way to remove alternates?
from puppet-alternatives.
I think, the variable @property_hash[:altname] in file lib /puppet/provider/alternative_entry/dpkg.rb on line 17 is empty.
the request of '/usr/sbin/update-alternatives --list ' gets a error:
-su: /usr/sbin/update-alternatives --list : Datei oder Verzeichnis nicht gefunden
here reminder my manifest:
alternative_entry { '/bin/nano':
ensure => 'present',
altlink => '/usr/bin/editor',
altname => 'editor',
priority => '5',
}
from puppet-alternatives.
I created a pull request with fixes of the bug(s) that trouble @lgbff
from puppet-alternatives.
alternative_entry merged to master.
from puppet-alternatives.
It would be nice if this feature was added to the documentation.
from puppet-alternatives.
@stkerr if you have a moment would you be able to submit a documentation pull request?
from puppet-alternatives.
Opened pull request #22 to add an example to the documentation.
from puppet-alternatives.
Related Issues (20)
- SLES 12 and 15 do not work with puppet-alternatives HOT 2
- Support slave links HOT 1
- No new version on Puppet Forge since 2019 HOT 2
- Could not determine mode after upgrade to 4.1.0
- Error: Could not autoload puppet/provider/alternatives/chkconfig HOT 1
- Could not evaluate: undefined method `[]' for nil:NilClass HOT 7
- Add support for Puppet 8 HOT 1
- Warnings when using Module HOT 1
- Missing provider for AWS Linux
- manual install HOT 2
- How does one set alternative entry back to 'auto' mode? HOT 2
- Release to forge HOT 3
- plugin sync error? HOT 3
- alternative_entry keying to the wrong parameter?
- seting multiple alternatives to the same path HOT 6
- Debian 6 with Ruby 1.8.7 broken HOT 3
- missing alternatives is not added - it breaks instead HOT 3
- Using a full path for path is not always desirable. HOT 6
- check debian support
- Could not determine auto or manual mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-alternatives.