- #HOW TO CHECK MAC ADDRESS IN RHEL INSTALL#
- #HOW TO CHECK MAC ADDRESS IN RHEL MANUAL#
- #HOW TO CHECK MAC ADDRESS IN RHEL SERIES#
This playbook will configure a static-network connection with a static IP address. Now run this playbook: $ ansible-playbook networkconfiguration.yml I used variables that are required to execute the network system role. ip: disable the DHCP option and assign an IP address using this parameter.state: activate the connection by using the up option.Network_connection - This variable contains information for new connections: This will help to find out the correct interface on a managed node. Target_mac - This is the MAC address of the second ethernet interface.
I'll explain each parameter step by step for you: name: playbook for configuring second interface Now write a playbook to add a new connection on the managed node:.
#HOW TO CHECK MAC ADDRESS IN RHEL INSTALL#
This command will install all system roles in the role's default directory. Now, after the service task, install system-roles on the controller: $ yum install rhel-system-roles
Display the MAC address of eno1 using: $ ip a Because you're using this MAC address, your playbook will find out the secondary interface. The secondary interface's name is eno1 so you can find the MAC address of this interface. If the playbook runs successfully without any errors, the service is started and enabled on the managed node machine. Run this playbook: $ ansible-playbook service.yml name: playbook for starting and enabling the NetworkManager For this task, use the service module in the service.yml file. That second network interface must be available.īefore doing any operation, confirm that the NetworkManager service is started and enabled on your managed node. Note: Be sure your managed node has two ethernet connections because it adds a new connection. I already created the entry of the managed node in the inventory file. In system-roles, you have the work role, which is the easiest way to configure and manage network settings on managed nodes.īegin by using this network system role to configure network settings on a managed node. In the previous article, I discussed Ansible system-roles. You can also use these modules to manage networks. In Ansible, you have three important modules that help you manage nodes: Service, daemon, and system settings. You want to manage network nodes by using an Ansible playbook.
#HOW TO CHECK MAC ADDRESS IN RHEL MANUAL#
However, as you know, you want to automate manual tasks that you would normally do with nmcli. Using the nmcli utility, you can add network connections and assign IPv4 or IPv6 addresses to create network connections. To display a list of all connections, you can use: $ nmcli con show Each connection has a name or ID that identifies it. The STATE column indicates the status of the connection, and the last one, CONNECTION, is a collection of settings that can be configured for a device. The TYPE column shows which type of connection is this. The first column, DEVICE, indicates the network interface.
In the above output, you can see various columns. To list the connections of your local machine use: $ nmcli dev status nmcli is the utility that's used to create and edit connections files from a shell prompt. It uses a file in /etc/sysconfig/network-scripts to store them. Basically, it's a daemon that monitors and manages network settings. NetworkManager manages network settings such as configuring the network interface as well as the connection. In this article, I look at the network role in detail so that you can modify the remote machine network connections with a single playbook. In that article, you saw an example where you changed SELinux mode using system.role-selinux role. System roles help you manage OS-level tasks like SELinux, managing network settings, NTP, etc. In the previous article, I introduced you to Ansible and system roles and provided some examples.
#HOW TO CHECK MAC ADDRESS IN RHEL SERIES#
This is the second article in series using Ansible system roles.