Some Vagrant fixes

Only install Dell OpenManage if not running in a VM, and fix SSH port
logic.
This commit is contained in:
Sam A. 2022-11-13 21:42:52 +01:00
parent 6a16328b7b
commit 581c832b36
Signed by: samsapti
GPG Key ID: CBBBE7371E81C4EA
6 changed files with 22 additions and 17 deletions

View File

@ -1,6 +1,6 @@
---
- hosts: all
gather_facts: False
gather_facts: false
become: true
vars:
base_domain: data.coop
@ -36,6 +36,6 @@
- import_role:
name: ubuntu_base
tags:
- base_only
- base_only
- import_role:
name: docker

View File

@ -2,6 +2,7 @@
- name: Install necessary packages via apt
apt:
name: "{{ packages }}"
state: latest
vars:
packages:
- aptitude
@ -9,7 +10,11 @@
- apparmor
- haveged
- mosh
- srvadmin-all # Dell OpenManage
- name: Install Dell OpenManage
apt:
name: srvadmin-all
when: ansible_virtualization_role != "guest"
- name: Install necessary packages via pip
pip:
@ -17,6 +22,5 @@
state: latest
vars:
packages:
- pip # upgrade needed for docker-compose to install
- docker
- docker-compose

View File

@ -1,15 +1,15 @@
---
- name: import dell apt signing key
- name: Import dell apt signing key
apt_key:
id: "1285491434D8786F"
keyserver: "keyserver.ubuntu.com"
- name: "configure dell apt repo"
- name: Configure dell apt repo
apt_repository:
repo: "deb https://linux.dell.com/repo/community/openmanage/10101/focal focal main"
state: "present"
state: present
- name: "restrict dell apt repo"
- name: Restrict dell apt repo"
copy:
dest: "/etc/apt/preferences.d/dell"
content: |
@ -17,7 +17,3 @@
Package: *
Pin: origin "linux.dell.com"
Pin-Priority: 400
- name: update apt cache
apt:
update_cache: yes

View File

@ -0,0 +1,3 @@
---
- name: Gather facts
gather_facts:

View File

@ -1,8 +1,11 @@
---
- import_tasks: ssh.yml
tags: [change-ssh-port]
- import_tasks: custom-apt-repos.yml
tags: [setup-custom-apt]
- import_tasks: facts.yml
tags: [gather-facts]
- import_tasks: dell-apt-repo.yml
tags: [setup-dell-apt-repo]
when: ansible_virtualization_role != "guest"
- import_tasks: upgrade.yml
tags: [do-full-system-upgrade]
- import_tasks: base.yml

View File

@ -2,8 +2,7 @@
- name: Check if SSH port is already configured
wait_for:
port: 19022
state: started
host: "{{ inventory_hostname }}"
host: "{{ ansible_host }}"
connect_timeout: 5
timeout: 10
become: false
@ -36,7 +35,7 @@
- name: Ensure sshd is reloaded if needed
meta: flush_handlers
- name: Change ansible_port 19022
- name: Change Ansible port to 19022
set_fact:
ansible_port: 19022
when: ssh_changed is defined