v0.0.6
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
ericomeehan.configure_network
|
||||
=========
|
||||
|
||||
Role to configure network interfaces for eom.dev.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
None
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
network_interfaces: A string defining network interfaces for a Debian node
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
None
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
Eric O'Neill Meehan
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# defaults file for configure_network
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# handlers file for configure_network
|
||||
@@ -1,34 +0,0 @@
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
# tasks file for Debian_firewall
|
||||
- name: Copy nftables configuration template
|
||||
template:
|
||||
src: "nftables.conf.j2"
|
||||
dest: /etc/nftables.conf
|
||||
|
||||
- name: Enable nftables
|
||||
service:
|
||||
name: nftables
|
||||
state: started
|
||||
enabled: true
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
# tasks file for Debian_interfaces
|
||||
- name: Configure network interfaces for a Debian node
|
||||
template:
|
||||
src: "Debian_interfaces.j2"
|
||||
dest: /etc/network/interfaces
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
# tasks file for configure_network
|
||||
- include_tasks: Debian_interfaces.yml
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- include_tasks: Debian_firewall.yml
|
||||
when: ansible_os_family == "Debian"
|
||||
@@ -1,10 +0,0 @@
|
||||
# This file describes the network interfaces available on your system
|
||||
# and how to activate them. For more information, see interfaces(5).
|
||||
|
||||
source /etc/network/interfaces.d/*
|
||||
|
||||
# The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
{{ network_interfaces }}
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/sbin/nft -f
|
||||
|
||||
flush ruleset
|
||||
|
||||
table inet filter {
|
||||
chain input {
|
||||
type filter hook input priority filter;
|
||||
{% for port in open_ports %}
|
||||
iifname "{{ port.interface }}" {{ port.protocol }} dport {{ port.port }} accept;
|
||||
{% endfor %}
|
||||
}
|
||||
chain forward {
|
||||
type filter hook forward priority filter;
|
||||
}
|
||||
chain output {
|
||||
type filter hook output priority filter;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
localhost
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- configure_network
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# vars file for configure_network
|
||||
@@ -5,28 +5,31 @@
|
||||
dest: /etc/apt/sources.list
|
||||
regexp: '^(deb(?!.* contrib).*)'
|
||||
replace: '\1 contrib non-free'
|
||||
|
||||
- name: Update apt
|
||||
become: yes
|
||||
apt:
|
||||
update_cache: yes
|
||||
when: nvidia == true
|
||||
|
||||
- name: Install Linux headers
|
||||
apt:
|
||||
name: linux-headers-{{ ansible_kernel }}
|
||||
state: present
|
||||
- name: Install Nvidia driver
|
||||
|
||||
- name: Install Nvidia and CUDA drivers
|
||||
apt:
|
||||
name: nvidia-driver
|
||||
state: present
|
||||
- name: Install necessary firmware
|
||||
apt:
|
||||
name: firmware-misc-nonfree
|
||||
state: present
|
||||
- name: Install CUDA drivers
|
||||
apt:
|
||||
name: nvidia-cuda-dev
|
||||
state: present
|
||||
- name: Install CUDA toolkit
|
||||
apt:
|
||||
name: nvidia-cuda-toolkit
|
||||
state: present
|
||||
name:
|
||||
- nvidia-driver
|
||||
- firmware-misc-nonfree
|
||||
- nvidia-cuda-dev
|
||||
- nvidia-cuda-toolkit
|
||||
|
||||
- name: Rebooting the system
|
||||
ansible.builtin.reboot:
|
||||
|
||||
- name: Wait for SSH connection
|
||||
ansible.builtin.wait_for_connection:
|
||||
timeout: 300
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
Dump debconf database
|
||||
=========
|
||||
|
||||
Dumps the debconf database after a fresh Debian installation.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
None
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
None
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
None
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- role: ericomeehan.dump-debconf-database
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
Eric O'Neill Meehan
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# defaults file for dump_debconf_database
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# handlers file for dump_debconf_database
|
||||
@@ -1,34 +0,0 @@
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
# tasks file for dump_debconf_db
|
||||
- name: Install debconf-utils
|
||||
apt:
|
||||
name: debconf-utils
|
||||
state: present
|
||||
|
||||
- name: Check if /root/preseed.txt exists
|
||||
stat:
|
||||
path: /root/preseed.txt
|
||||
register: preseed_file
|
||||
|
||||
- name: Create preseed file
|
||||
command: echo "#_preseed_V1" > /root/preseed.txt
|
||||
when: not preseed_file.stat.exists
|
||||
|
||||
- name: Append installer's debconf database to the file
|
||||
command: debconf-get-selections --installer >> /root/preseed.txt
|
||||
when: not preseed_file.stat.exists
|
||||
|
||||
- name: Append debconf database to the file
|
||||
command: debconf-get-selections >> /root/preseed.txt
|
||||
when: not preseed_file.stat.exists
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
# tasks file for dump_debconf_database
|
||||
- include_tasks: dump_debconf_db.yml
|
||||
when: ansible_os_family == "Debian"
|
||||
@@ -1,2 +0,0 @@
|
||||
localhost
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- dump_debconf_database
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# vars file for dump_debconf_database
|
||||
Reference in New Issue
Block a user