Giuseppe Lavagetto has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/325042 )

Change subject: Fix up puppet-compiler for labs usage
......................................................................


Fix up puppet-compiler for labs usage

 - switch from ldap to puppet-enc (needs to be provisioned seperately, TBD)
 - add missing self.realm parameter to ManageCode instantiation

Change-Id: I62a4cd2b61673f34548c01d4e1010a5b1f7700a0
---
M puppet_compiler/controller.py
M puppet_compiler/prepare.py
M puppet_compiler/tests/test_prepare.py
3 files changed, 6 insertions(+), 16 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/puppet_compiler/controller.py b/puppet_compiler/controller.py
index 772ddfb..6722380 100644
--- a/puppet_compiler/controller.py
+++ b/puppet_compiler/controller.py
@@ -60,7 +60,7 @@
         self.count = defaultdict(int)
         self.pick_hosts(host_list)
         directories.FHS.setup(job_id, self.config['base'])
-        self.m = prepare.ManageCode(self.config, job_id, change_id)
+        self.m = prepare.ManageCode(self.config, job_id, change_id, self.realm)
         self.outdir = directories.FHS.output_dir
         # State of all nodes
         self.state = state.StatesCollection()
diff --git a/puppet_compiler/prepare.py b/puppet_compiler/prepare.py
index d7e9d24..af9dde0 100644
--- a/puppet_compiler/prepare.py
+++ b/puppet_compiler/prepare.py
@@ -1,6 +1,5 @@
 from contextlib import contextmanager
 import json
-import yaml
 import subprocess
 import os
 import shutil
@@ -135,21 +134,13 @@
 
         template = """# This file has been generated by puppet-compiler.
 [master]
-    node_terminus = ldap
-    ldapbase = ou=hosts,dc=wikimedia,dc=org
-    ldapstring = (&(objectclass=puppetClient)(associatedDomain=%s))
-    ldaptls = true
-    ldappassword = {password}
-    ldapuser = {user}
-    ldapserver = {servers[0]}
+    node_terminus = exec
+    external_nodes = /usr/local/bin/puppet-enc
 """
 
-        with open(LDAP_YAML_PATH) as f:
-            config = yaml.safe_load(f)
-
         with open('puppet.conf', 'w') as f:
-            f.write(template.format(**config))
-        _log.debug('Wrote puppet.conf with ldap settings')
+            f.write(template)
+        _log.debug('Wrote puppet.conf with puppet-enc settings')
 
     def _fetch_change(self):
         """get changes from the change directly"""
diff --git a/puppet_compiler/tests/test_prepare.py 
b/puppet_compiler/tests/test_prepare.py
index 5a74468..ed95362 100644
--- a/puppet_compiler/tests/test_prepare.py
+++ b/puppet_compiler/tests/test_prepare.py
@@ -80,8 +80,7 @@
             with open(fn) as f:
                 data = f.read()
             os.unlink(fn)
-        self.assertIn('ldapuser = cn=proxyagent', data)
-        self.assertIn('password = not_the_password', data)
+        self.assertIn('node_terminus = exec', data)
 
     @mock.patch('subprocess.call')
     def test_fetch_change(self, mocker):

-- 
To view, visit https://gerrit.wikimedia.org/r/325042
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I62a4cd2b61673f34548c01d4e1010a5b1f7700a0
Gerrit-PatchSet: 4
Gerrit-Project: operations/software/puppet-compiler
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>
Gerrit-Reviewer: Andrew Bogott <abog...@wikimedia.org>
Gerrit-Reviewer: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to