Re: problem with cloud-init-0.7.9-9.el7.centos.2.x86_64 setting up puppet.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I changed the pathes in
/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.py and compiled
it new. Then ive overwritten the orginal files. That didn?t help.

Im using the official client from puppetlabs and the pathes are

PUPPET_CONF_PATH = '/etc/puppetlabs/puppet/puppet.conf'
PUPPET_SSL_CERT_DIR = '/etc/puppetlabs/puppet/ssl/certs/'
PUPPET_SSL_DIR = '/etc/puppetlabs/puppet/ssl'
PUPPET_SSL_CERT_PATH = '/etc/puppetlabs/puppet/ssl/certs/ca.pem'

The new error im getting then is
---------------------
2017-12-04 20:15:15,979 - util.py[WARNING]: Running module puppet (<module
'cloudinit.config.cc_puppet' from
'/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.py'>) failed
2017-12-04 20:15:15,979 - util.py[DEBUG]: Running module puppet (<module
'cloudinit.config.cc_puppet' from
'/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.py'>) failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 777, in
_run_modules
    freq=freq)
  File "/usr/lib/python2.7/site-packages/cloudinit/cloud.py", line 54, in
run
    return self._runners.run(name, functor, args, freq, clear_on_fail)
  File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 187, in
run
    results = functor(*args)
  File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.py",
line 145, in handle
    util.write_file(PUPPET_CONF_PATH, puppet_config.stringify())
  File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 442, in
stringify
    with six.StringIO() as outputstream:
AttributeError: StringIO instance has no attribute '__exit__'
-------------------------


So I had to use epel repos and the fedora devel repo for cloud-init
https://copr-be.cloud.fedoraproject.org/results/@cloud-init/cloud-init-dev/e
pel-7-$basearch/

in order to install the cloud-init-17.1+46.g7acc9e68-1.el7.centos.noarch
version.

This fixes the problem with StringIO.

You should get this in the official repo for centos7.

I opened also a bug with cloud-init for the path issue.

https://bugs.launchpad.net/cloud-init/+bug/1736261


BR

Christian



-----Ursprüngliche Nachricht-----
Von: CentOS [mailto:centos-bounces@xxxxxxxxxx] Im Auftrag von
ybaumy@lost-frequencies.cloud
Gesendet: Montag, 4. Dezember 2017 19:18
An: centos@xxxxxxxxxx
Betreff:  problem with cloud-init-0.7.9-9.el7.centos.2.x86_64
setting up puppet.conf

When running cloud-init im getting the following error

Cloud-init v. 0.7.9 running 'modules:config' at Mon, 04 Dec 2017 18:07:26
+0000. Up 2597.52 seconds.
Loaded plugins: fastestmirror, product-id, search-disabled-repos,
subscription-manager This system is not registered with an entitlement
server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
 * base: mirror.yannic-bonenberger.com
 * extras: mirror.yannic-bonenberger.com
 * updates: centos.bio.lmu.de
Package puppet-agent-1.10.9-1.el7.x86_64 already installed and latest
version Nothing to do
2017-12-04 18:07:27,102 - util.py[WARNING]: Running module puppet (<module
'cloudinit.config.cc_puppet' from
'/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.pyc'>) failed


This is from /var/log/cloud-init.log

-------------------------

2017-12-04 18:07:26,579 - stages.py[DEBUG]: Running module puppet (<module
'cloudinit.config.cc_puppet' from
'/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.pyc'>) with
frequency once-per-instance
2017-12-04 18:07:26,579 - handlers.py[DEBUG]: start:
modules-config/config-puppet: running config-puppet with frequency
once-per-instance
2017-12-04 18:07:26,579 - util.py[DEBUG]: Writing to
/var/lib/cloud/instances/nocloud/sem/config_puppet - wb: [420] 20 bytes
2017-12-04 18:07:26,580 - util.py[DEBUG]: Restoring selinux mode for
/var/lib/cloud/instances/nocloud/sem/config_puppet (recursive=False)
2017-12-04 18:07:26,580 - util.py[DEBUG]: Restoring selinux mode for
/var/lib/cloud/instances/nocloud/sem/config_puppet (recursive=False)
2017-12-04 18:07:26,581 - helpers.py[DEBUG]: Running config-puppet using
lock (<FileLock using file
'/var/lib/cloud/instances/nocloud/sem/config_puppet'>)
2017-12-04 18:07:26,581 - cc_puppet.py[DEBUG]: Attempting to install puppet
latest,
2017-12-04 18:07:26,581 - util.py[DEBUG]: Running command ['yum', '-t',
'-y', 'install', 'puppet'] with allowed return codes [0] (shell=False,
capture=False)
2017-12-04 18:07:27,101 - util.py[DEBUG]: Reading from
/etc/puppet/puppet.conf (quiet=False)
2017-12-04 18:07:27,102 - handlers.py[DEBUG]: finish:
modules-config/config-puppet: FAIL: running config-puppet with frequency
once-per-instance
2017-12-04 18:07:27,102 - util.py[WARNING]: Running module puppet (<module
'cloudinit.config.cc_puppet' from
'/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.pyc'>) failed
2017-12-04 18:07:27,102 - util.py[DEBUG]: Running module puppet (<module
'cloudinit.config.cc_puppet' from
'/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.pyc'>) failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 777, in
_run_modules
    freq=freq)
  File "/usr/lib/python2.7/site-packages/cloudinit/cloud.py", line 54, in
run
    return self._runners.run(name, functor, args, freq, clear_on_fail)
  File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 187, in
run
    results = functor(*args)
  File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_puppet.py",
line 107, in handle
    contents = util.load_file(PUPPET_CONF_PATH)
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1278, in
load_file
    with open(fname, 'rb') as ifh:
IOError: [Errno 2] No such file or directory: '/etc/puppet/puppet.conf

------------------------

To get around this error with the missing /etc/puppet/puppet.conf I created
a directory and link for the .conf since the original location is in
/etc/puppetlabs/puppet/puppet.conf

[root@kent-hanchett puppet]# pwd
/etc/puppet
[root@kent-hanchett puppet]# ls -la
total 12
drwxr-xr-x.  2 root root   29 Dec  4 18:13 .
drwxr-xr-x. 79 root root 8192 Dec  4 18:13 ..
lrwxrwxrwx.  1 root root   34 Dec  4 18:13 puppet.conf.old ->
/etc/puppetlabs/puppet/puppet.conf

But after the run you can see that it was renamed to .old and the error
appears again.

So how can I set either to correct path to puppet.conf or how do I handle
this situation?

Any ideas would be appreciated.

BR

Christian



















_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux