bifrost/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml
stephane 3853df0e1b Use "state=touch" instead of running touch
In the bifrost-openstack-ci-prep role we ran touch,
but we can actually do this using ansible's file
module. Fix it to get rid of a warning.

Change-Id: I8e320d0c1a3f8d384c9aab405ec54be5543823db
Closes-Bug: #1523729
2016-01-06 17:13:08 -08:00

43 lines
1.5 KiB
YAML

# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# NOTE(TheJulia): Override the stored fact values for username/password when operating
# in OpenStack CI.
- name: "Set facts for OpenStack CI"
set_fact:
mysql_username: "openstack_citest"
mysql_password: "openstack_citest"
disable_dnsmasq_dns: True
when: ci_testing_zuul_changes is defined
- name: "Determine if OpenStack CI is missing an SSH key"
stat: path={{ssh_public_key_path}}
register: test_ssh_public_key_path
when: ci_testing_zuul is defined
- name: "Create an SSH key for Jenkins user if operating in OpenStack CI"
shell: ssh-keygen -f ~/.ssh/id_rsa -N ""
when: >
ci_testing_zuul is defined and
test_ssh_public_key_path.stat.exists |bool == false
- name: >
"Create an empty SSH known_hosts file for Jenkins user
if operating in OpenStack CI"
file:
path: "~/.ssh/known_hosts"
state: touch
mode: 0600
when: >
ci_testing_zuul is defined and
test_ssh_public_key_path.stat.exists | bool == false