Bug 1344365

Summary: Undercloud installation fails when reaching 'pki_initialization'
Product: Red Hat OpenStack Reporter: Arie Bregman <abregman>
Component: instack-undercloudAssignee: James Slagle <jslagle>
Status: CLOSED NOTABUG QA Contact: Arik Chernetsky <achernet>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: afazekas, mburns, rhel-osp-director-maint, sbaker
Target Milestone: ---Keywords: Automation, AutomationBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-13 08:10:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Arie Bregman 2016-06-09 13:29:59 UTC
Description of problem:

Undercloud installation fails with the following error: "[Command '['dib-run-parts', '/usr/libexec/os-refresh-config/post-configure.d']' returned non-zero exit status 1]"

Version-Release number of selected component (if applicable): 7


How reproducible: 100%

Steps to Reproduce:
1. Install latest puddle repo
2. Install undercloud

Actual results:

PKI initialization in init-keystone is deprecated and will be removed.
Traceback (most recent call last):
  File "/bin/init-keystone", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/os_cloud_config/cmd/init_keystone.py", line 88, in main
    args.user, args.timeout, args.pollinterval, args.pkisetup)
  File "/usr/lib/python2.7/site-packages/os_cloud_config/keystone.py", line 158, in initialize
    _perform_pki_initialization(host, user)
  File "/usr/lib/python2.7/site-packages/os_cloud_config/keystone.py", line 537, in _perform_pki_initialization
    "$(getent group | grep '^keystone' | cut -d: -f1)"])
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ssh', '-oStrictHostKeyChecking=no', '-t', '-l', 'root', '192.0.2.1', 'sudo', 'keystone-manage', 'pki_setup', '--keystone-user', "$(getent passwd | grep '^keystone' | cut -d: -f1)", '--keystone-group', "$(getent group | grep '^keystone' | cut -d: -f1)"]' returned non-zero exit status 1
[2016-06-09 09:08:21,942] (os-refresh-config) [ERROR] during post-configure phase. [Command '['dib-run-parts', '/usr/libexec/os-refresh-config/post-configure.d']' returned non-zero exit status 1]

Expected results: Undercloud installation completed successfully

Additional info:

My undercloud.conf

DEFAULT]
local_ip = 192.0.2.1/24
undercloud_public_vip = 192.0.2.2
undercloud_admin_vip = 192.0.2.3
local_interface=eth1
masquerade_network = 192.0.2.0/24
dhcp_start = 192.0.2.5
dhcp_end = 192.0.2.24
network_cidr = 192.0.2.0/24
network_gateway = 192.0.2.1
discovery_iprange = 192.0.2.100,192.0.2.120

Comment 3 Steve Baker 2016-06-13 00:45:33 UTC
I just hit this on RHOS-8 - I assume its a tty issue because I'm running "openstack undercloud install" remotely via ansible.

My workaround was the following ansible task, run before "openstack undercloud install"

- name: sudoers no tty
  become: yes
  lineinfile: dest=/etc/sudoers state=absent regexp='Defaults\s+requiretty'

Comment 4 Arie Bregman 2016-06-13 08:10:33 UTC
@Steve thanks, it fixed the issue for me. I wonder why it started to fail only now, after using the same image and automated installation for weeks. Also happens only for osp 7, although I'm using the same Ansible tasks for 8 and 9 releases.

Closing the "bug".

Comment 5 Steve Baker 2016-06-13 21:14:47 UTC
It happened for me in 8, there might be a different PKI setup method in 9, since 8 posts a deprecation message.