bootstrap: rework role (#4045)

* bootstrap: rework role

* support being called from a non-root user
* run some commands in check mode
* unify spelling/task names

* bootstrap: fix wording of comments for check_mode: false

* bootstrap: remove setup-pipelining task
This commit is contained in:
MarkusTeufelberger
2019-02-11 23:04:27 +01:00
committed by Kubernetes Prow Robot
parent 038a2eb862
commit e2ad6aad5a
9 changed files with 94 additions and 64 deletions

View File

@@ -3,6 +3,8 @@
raw: cat /etc/os-release
register: os_release
changed_when: false
# This command should always run, even in check mode
check_mode: false
environment: {}
- include_tasks: bootstrap-ubuntu.yml
@@ -26,8 +28,6 @@
- include_tasks: bootstrap-clearlinux.yml
when: '"Clear Linux OS" in os_release.stdout'
- import_tasks: setup-pipelining.yml
- name: Create remote_tmp for it is used by another module
file:
path: "{{ lookup('config', 'DEFAULT_REMOTE_TMP', on_missing='skip', wantlist=True) | first | default('~/.ansible/tmp') }}"
@@ -41,13 +41,13 @@
- name: Assign inventory name to unconfigured hostnames (non-CoreOS and Tumbleweed)
hostname:
name: "{{inventory_hostname}}"
name: "{{ inventory_hostname }}"
when:
- override_system_hostname
- ansible_os_family not in ['Suse', 'CoreOS', 'Container Linux by CoreOS', 'ClearLinux']
- name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
command: "hostnamectl set-hostname {{inventory_hostname}}"
command: "hostnamectl set-hostname {{ inventory_hostname }}"
register: hostname_changed
when:
- override_system_hostname