Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #121

Merged
merged 4 commits into from
Sep 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [v3.1.0](https://github.com/buluma/ansible-role-bootstrap/tree/v3.1.0) (2022-08-20)

[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v3.0.6...v3.1.0)

## [v3.0.6](https://github.com/buluma/ansible-role-bootstrap/tree/v3.0.6) (2022-08-06)

[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v3.0.5...v3.0.6)
Expand Down Expand Up @@ -127,23 +131,23 @@

## [v1.0.7](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.7) (2022-02-02)

[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.6...v1.0.7)
[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.4...v1.0.7)

## [v1.0.6](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.6) (2022-01-30)
## [v1.0.4](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.4) (2022-01-30)

[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.5...v1.0.6)
[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.5...v1.0.4)

## [v1.0.5](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.5) (2022-01-30)

[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.3...v1.0.5)
[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.6...v1.0.5)

## [v1.0.3](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.3) (2022-01-30)
## [v1.0.6](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.6) (2022-01-30)

[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.4...v1.0.3)
[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.3...v1.0.6)

## [v1.0.4](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.4) (2022-01-30)
## [v1.0.3](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.3) (2022-01-30)

[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.2...v1.0.4)
[Full Changelog](https://github.com/buluma/ansible-role-bootstrap/compare/v1.0.2...v1.0.3)

## [v1.0.2](https://github.com/buluma/ansible-role-bootstrap/tree/v1.0.2) (2022-01-30)

Expand Down
4 changes: 2 additions & 2 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---

- name: test if bootstrap_wait_for_host is set correctly
- name: Test if bootstrap_wait_for_host is set correctly
ansible.builtin.assert:
that:
- bootstrap_wait_for_host is defined
- bootstrap_wait_for_host is boolean
quiet: yes

- name: test if bootstrap_timeout is set correctly
- name: Test if bootstrap_timeout is set correctly
ansible.builtin.assert:
that:
- bootstrap_timeout is defined
Expand Down
6 changes: 3 additions & 3 deletions tasks/gather_facts.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---

- name: lookup bootstrap facts
- name: Lookup bootstrap facts
ansible.builtin.raw: "cat /etc/os-release"
become: no
check_mode: no
register: bootstrap_facts
changed_when: no

- name: set bootstrap facts (I)
- name: Set bootstrap facts (I)
ansible.builtin.set_fact:
bootstrap_distribution: "{{ item }}"
bootstrap_distribution_major_version: "{{ bootstrap_facts.stdout_lines | join(',') | regex_replace(
Expand All @@ -19,7 +19,7 @@
- bootstrap_facts.stdout is regex('PRETTY_NAME=.'~ bootstrap_search[item] | default(item) ~'.*')
become: no

- name: set bootstrap facts (II)
- name: Set bootstrap facts (II)
ansible.builtin.set_fact:
bootstrap_os_family: "{{ item.key }}"
loop: "{{ bootstrap_os_family_map | dict2items }}"
Expand Down
30 changes: 15 additions & 15 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# tasks file for bootstrap

- name: import assert.yml
- name: Import assert.yml
ansible.builtin.import_tasks: assert.yml
run_once: yes
delegate_to: localhost

- name: wait for port to be available
- name: Wait for port to be available
ansible.builtin.wait_for:
port: "{{ ansible_port | default('22') }}"
timeout: "{{ bootstrap_timeout }}"
Expand All @@ -16,19 +16,19 @@
- ansible_connection not in [ "container", "docker", "community.docker.docker" ]
- bootstrap_wait_for_host | bool

- name: prepare system
- name: Prepare system
block:
- name: test connection
- name: Test connection
ansible.builtin.wait_for_connection:
timeout: "{{ bootstrap_timeout }}"
register: bootstrap_connect
changed_when: no
rescue:
- name: gather bootstrap facts
- name: Gather bootstrap facts
ansible.builtin.include_tasks:
file: gather_facts.yml

- name: install bootstrap packages (raw)
- name: Install bootstrap packages (raw)
ansible.builtin.raw: "{{ bootstrap_install.raw }}"
register: bootstrap_install_packages
changed_when:
Expand All @@ -39,54 +39,54 @@
become: no


- name: ensure system is prepared
- name: Ensure system is prepared
block:
- name: gather ansible facts
- name: Gather ansible facts
ansible.builtin.setup:

- name: install bootstrap packages (apt)
- name: Install bootstrap packages (apt)
ansible.builtin.apt:
name: "{{ bootstrap_facts_packages.split() }}"
update_cache: yes
changed_when: no
when: ansible_pkg_mgr == "apt"

- name: install bootstrap packages (yum)
- name: Install bootstrap packages (yum)
ansible.builtin.yum:
name: "{{ bootstrap_facts_packages.split() }}"
update_cache: yes
changed_when: no
when: ansible_pkg_mgr == "yum"

- name: install bootstrap packages (apk)
- name: Install bootstrap packages (apk)
community.general.apk:
name: "{{ bootstrap_facts_packages.split() }}"
update_cache: yes
changed_when: no
when: ansible_pkg_mgr == "apk"

- name: install bootstrap packages (dnf)
- name: Install bootstrap packages (dnf)
ansible.builtin.dnf:
name: "{{ bootstrap_facts_packages.split() }}"
update_cache: yes
changed_when: no
when: ansible_pkg_mgr == "dnf"

- name: install bootstrap packages (zypper)
- name: Install bootstrap packages (zypper)
community.general.zypper:
name: "{{ bootstrap_facts_packages.split() }}"
update_cache: yes
changed_when: no
when: ansible_pkg_mgr == "zypper"

- name: install bootstrap packages (pacman)
- name: Install bootstrap packages (pacman)
community.general.pacman:
name: "{{ bootstrap_facts_packages.split() }}"
update_cache: yes
changed_when: no
when: ansible_pkg_mgr == "pacman"

- name: install bootstrap packages (portage)
- name: Install bootstrap packages (portage)
community.general.portage:
package: "{{ bootstrap_facts_packages.split() }}"
sync: yes
Expand Down