windmill-ops/playbooks/bootstrap-ansible/site.yaml

44 lines
1.2 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: 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