Host management improvements
This commit is contained in:
@@ -1,23 +1,29 @@
|
||||
# Note: need to specify extra_vars, providing ansible_ssh_user, and ansible_ssh_pass
|
||||
|
||||
- name: Set up IPA Client
|
||||
hosts: tag_ipa_client
|
||||
become: yes
|
||||
collections:
|
||||
- freeipa.ansible_freeipa
|
||||
pre_tasks:
|
||||
- name: Set hostname
|
||||
hostname:
|
||||
name: "{{inventory_hostname}}"
|
||||
|
||||
- name: Attach subscriptions
|
||||
command: '/usr/bin/subscription-manager attach'
|
||||
register: result
|
||||
changed_when:
|
||||
- '"All installed products are covered by valid entitlements. No need to update subscriptions at this time." not in result.stdout'
|
||||
when: ansible_distribution == "RedHat"
|
||||
|
||||
|
||||
roles:
|
||||
- role: debian-freeipa-client
|
||||
when: ansible_facts['os_family'] == "Debian"
|
||||
when: ansible_os_family == "Debian"
|
||||
- role: ipaclient
|
||||
state: present
|
||||
when: ansible_facts['os_family'] == "RedHat"
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Set up Basic Lab Packages
|
||||
hosts: all
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I started this to create a filter that would translate netbox to linux-system-roles/network.
|
||||
|
||||
from ansible.utils.display import Display
|
||||
|
||||
from ansible.parsing.yaml import dumper
|
||||
display = Display()
|
||||
|
||||
def get_type(intf_type):
|
||||
@@ -16,7 +16,6 @@ def get_type(intf_type):
|
||||
|
||||
|
||||
def translate_interface(interface):
|
||||
display.vv(interface)
|
||||
|
||||
lsrint = {
|
||||
'name': interface['name'],
|
||||
|
||||
17
pimgmt.yml
17
pimgmt.yml
@@ -1,23 +1,6 @@
|
||||
---
|
||||
# Configure a Raspberry Pi running Fedora 32+ for Management functions.
|
||||
- name: Configure interfaces
|
||||
hosts: pimgmt
|
||||
gather_facts: false
|
||||
connection: local
|
||||
vars:
|
||||
network_provider: nm
|
||||
|
||||
tasks:
|
||||
- set_fact:
|
||||
network_connections: >-
|
||||
{{ network_connections|default([]) + [{
|
||||
'name': item.name,
|
||||
'state': item.enabled |ternary('up','down')
|
||||
}] }}
|
||||
loop: "{{ interfaces }}"
|
||||
|
||||
- debug:
|
||||
msg: "Connections = {{ network_connections }}"
|
||||
|
||||
# - name: Set Up DHCP System
|
||||
# hosts: dhcp-server
|
||||
|
||||
11
site.yml
11
site.yml
@@ -1,6 +1,15 @@
|
||||
# Toal Lab Site Playbook
|
||||
- name: Set up Network interfaces
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
become: true
|
||||
|
||||
roles:
|
||||
- name: linux-system-roles.network
|
||||
when: network_connections is defined
|
||||
|
||||
- name: Common Lab Machine Setup
|
||||
hosts: platform_linux
|
||||
hosts: platform_linux,platform_fedora_linux
|
||||
become: true
|
||||
roles:
|
||||
- toal-common
|
||||
|
||||
Reference in New Issue
Block a user