LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-21-2017, 05:43 AM   #1
ofirbs
LQ Newbie
 
Registered: Jun 2014
Posts: 7

Rep: Reputation: Disabled
Automate sssd with puppet module


Hi,

I'm trying to create an automation for sssd (without manual interference).
For that, I have created a puppet module which installs the necessary packages for sssd,
configures the necessary configuration files,
and runs a script that adds the server to our Active Directory.

My module executes a bash script that runs the following commands:

Code:
<call my API that adds a Computer Account for the server in the Active Directory>
echo "Password" | kinit User 
sleep 30 #Let the new computer account to be replicated to all DCs
/usr/bin/net ads join -k
sleep 3 # Let it sync
/usr/bin/kinit -k $(/usr/bin/kllist -k | tail -n1 | awk '{print $NF}' | cut -d"@" -f1)
sleep 3 # Just for safety
/usr/bin/authconfig --enablesssdauth --enablesssd --enablemkhomedir --update

If I run the script manually, it works great.
But if the script runs from within the puppet module, the 'net ads join -k' command fails with error 255 (no documentation for that)
The 'echo "Password" | kinit User' is not best practice as well, but I have not found a better automatic solution, and it seems to work fine because the exit code is 0.

My Questions are:
1. What could be wrong?
2. Is there a better solution for what I am trying to achieve?
(reminder: I do not want to run the script manually on my servers)
 
Old 05-25-2017, 04:58 PM   #2
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
Add -UUser%secret or just -UUser so the AD server is not seeing the join as the user who is running the script which isn't the same User that did the kinit.
 
Old 08-24-2017, 03:13 AM   #3
ofirbs
LQ Newbie
 
Registered: Jun 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Managed to solve this problem:

add the following lines to the puppet module pp file:

environment => [
'USER=root',
'LOGNAME=root',
'HOME=/root',
]
 
  


Reply

Tags
active directory, kerberos, module, puppet, sssd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sssd: Benign local domain sssd.conf needed boxyzzy Linux - Server 1 10-06-2016 01:31 PM
Puppet - mysql module not pulling “my.cnf” from fileserver sndlt Linux - Server 1 05-13-2015 05:18 PM
Puppet - JIRA module not connecting to mySQL sndlt Linux - Server 0 05-13-2015 12:45 AM
Puppet: [warn] module passenger_module is already loaded, skipping don boyage Linux - Server 1 12-06-2014 11:36 PM
LXer: Speaking Unix, Part 6: Automate, automate, automate! LXer Syndicated Linux News 0 01-04-2007 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration