Coder Social home page Coder Social logo

Comments (12)

jg-development avatar jg-development commented on July 21, 2024 1

Hi,
I tried with the following:
Vagrant Box with Ubuntu 16.04
Puppet 4.8.1
sudo version 4.1.0

sudo.yaml

---
classes:
    - sudo
sudo:
  ensure: present
sudo::configs:
  'ubuntu_admin':
    content: "ubuntu ALL=(ALL) NOPASSWD: ALL"
    priority: 10

default.pp

include ::sudo
include ::sudo::configs

Result:
The sudoers file does not get overwritten and the configs are not included.
With the modification from above it does work:

$configs = lookup('sudo::configs', Hash, {"strategy" => "deep", "merge_hash_arrays" => true}, $configs_hash)

Greetings
Jan

from puppet-sudo.

borian avatar borian commented on July 21, 2024

I am having the same issue

the variables to replace the file are set correctly:

  • $file_ensure: present
  • $config_file_group: root
  • $config_file_replace: true
  • $source: puppet:///modules/sudo/filessudoers.ubuntu

from puppet-sudo.

jg-development avatar jg-development commented on July 21, 2024

Hi,
the problem ist in the config.pp

$configs = hiera_hash('sudo::configs', $configs_hash)

Hiera with puppet 4 now uses lookup
new example with deep merge:

$configs = lookup('sudo::configs', Hash, {"strategy" => "deep", "merge_hash_arrays" => true}, $configs_hash)

Greetings Jan

from puppet-sudo.

law avatar law commented on July 21, 2024

I am also having this same issue

from puppet-sudo.

saz avatar saz commented on July 21, 2024

Can you try it with the newest release, if this is still happening for you?

from puppet-sudo.

saz avatar saz commented on July 21, 2024

Any news on this?

from puppet-sudo.

jg-development avatar jg-development commented on July 21, 2024

I think I can try it today and give u some feedback

from puppet-sudo.

template-provider avatar template-provider commented on July 21, 2024

hi ... which version do you mean?
works for me:

root@tp64:/home/ubuntu# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
ubuntu@tp64:~$ puppet agent --version
4.10.0
root@tp64:/home/ubuntu# cat /etc/sudoers.d/10_ubuntu_admin 
ubuntu ALL=(ALL) NOPASSWD: ALL

from puppet-sudo.

template-provider avatar template-provider commented on July 21, 2024

Tested with module version 4.10

from puppet-sudo.

jg-development avatar jg-development commented on July 21, 2024

Hi @hboetes ,
/etc/sudoers is replaced for me too.

root@tp64:/home/ubuntu# cat /etc/sudoers
# file managed by puppet (unless config_file_replace=false)
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults	env_reset
Defaults	mail_badpass
Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root	ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
==> default: Notice: /Stage[main]/Sudo/File[/etc/sudoers]/content: content changed '{md5}e8e73f16ed73309df7574c12fbcc0af7' to '{md5}96d9cd290b72e37c1079aa2b4469491a'

Greetings Jan

from puppet-sudo.

jg-development avatar jg-development commented on July 21, 2024

Hi,
I only use the hiera lookup as seen above with:

  include ::sudo
  include ::sudo::configs

Every change in the template file results in a new sudoers files. From my side with the pull request everything ist ok. Could you test it with a hiera lookup?
Greeting Jan

from puppet-sudo.

saz avatar saz commented on July 21, 2024

Please give the current master a try

from puppet-sudo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.