Paul Belanger 0465f83c48 Create launch-node.py
This adds the ability for users to boot a server on openstack then
bootstrap the server for ansible, then windmill.  There is a fair bit of
assumptions here, but this is a good first start.

Change-Id: Iae2cf70975ba9ad621401db609849b4ebb8efe5d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-02-27 09:16:48 -05:00

50 lines
1.4 KiB
YAML

# Copyright 2019 Red Hat, Inc.
#
# 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.
---
- hosts: all
gather_facts: false
tasks:
- name: bootstrap ansible
raw: sudo apt-get update && sudo apt-get install -y python3-minimal && sudo apt-get clean
tags: skip_ansible_lint
- hosts: all
tasks:
- name: Update apt cache
become: true
apt:
update_cache: true
upgrade: dist
- import_playbook: ../bootstrap/site.yaml
- hosts: all
tasks:
- name: Disable password for sudo users
become: true
copy:
content: "%sudo ALL=(ALL) NOPASSWD: ALL"
dest: /etc/sudoers.d/sudo
- name: reboot
become: true
reboot:
# NOTE(pabelanger): This user should be completely removed but cannot here
# because we are using the ubuntu user to bootstrap the server.
- name: Disable SSH access for ubuntu user
file:
path: ~/.ssh
state: absent