-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #10: Make playbook work well on Ubuntu hosts.
- Loading branch information
1 parent
23850f7
commit b8544ff
Showing
6 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: Prepare Ubuntu for static networking. | ||
hosts: cluster | ||
gather_facts: false | ||
become: true | ||
|
||
vars: | ||
netplan_file: /etc/netplan/50-cloud-init.yaml | ||
|
||
tasks: | ||
- name: Ensure NetworkManager is installed. | ||
ansible.builtin.apt: | ||
name: network-manager | ||
state: present | ||
update_cache: true | ||
|
||
- name: Configure netplan file for NetworkManager. | ||
ansible.builtin.copy: | ||
dest: "{{ netplan_file }}" | ||
mode: 0600 | ||
content: | | ||
# ANSIBLE MANAGED - netplan configuration | ||
network: | ||
version: 2 | ||
renderer: NetworkManager | ||
- name: Regenerate netplan config. | ||
ansible.builtin.command: "{{ item }}" | ||
with_items: | ||
- sudo netplan generate | ||
- sudo netplan apply | ||
|
||
- name: Reboot. | ||
ansible.builtin.reboot: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters