Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
playbooks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
playbooks
Commits
cb509814
Commit
cb509814
authored
Jan 03, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hypervisor
parent
e9d0ab44
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
2 deletions
+74
-2
files/hypervisor/iptables-forward.sh
files/hypervisor/iptables-forward.sh
+6
-0
hypervisor.yml
hypervisor.yml
+61
-0
init.yml
init.yml
+7
-2
No files found.
files/hypervisor/iptables-forward.sh
0 → 100755
View file @
cb509814
#!/bin/bash
sudo
iptables
-t
nat
-A
PREROUTING
-m
addrtype
--dst-type
LOCAL
-p
tcp
-m
tcp
--dport
$1
-j
DNAT
--to-destination
$2
sudo
iptables
-t
nat
-A
PREROUTING
-m
addrtype
--dst-type
LOCAL
-p
udp
-m
udp
--dport
$1
-j
DNAT
--to-destination
$2
cp
./ipt ./ipt.bak
sudo
iptables-save
>
./ipt
#netfilter-persistent save
hypervisor.yml
0 → 100644
View file @
cb509814
---
-
hosts
:
hypervisor
remote_user
:
root
tasks
:
-
name
:
apt
become
:
true
when
:
"
ansible_distribution
!=
'CentOS'"
apt
:
state
:
latest
update_cache
:
true
name
:
sudo,python,qemu,qemu-kvm,libvirt-bin,bridge-utils,virtinst,libguestfs-tools,python-libvirt,python-lxml
-
name
:
yum
become
:
true
when
:
"
ansible_distribution
==
'CentOS'
and
ansible_distribution_major_version|int
<=
7"
yum
:
state
:
latest
update_cache
:
true
name
:
sudo,python,kvm,qemu-kvm,qemu-kvm-tools,qemu-img,libvirt,libvirt-python,libguestfs-tools,bridge-utils,virt-install,python-lxml
-
name
:
dnf
become
:
true
when
:
"
ansible_distribution
==
'CentOS'
and
ansible_distribution_major_version|int
==
8"
dnf
:
state
:
latest
name
:
sudo,python3,qemu-kvm,qemu-img,libvirt,python3-libvirt,libguestfs-tools,virt-install,python3-lxml
-
name
:
libvirt service
become
:
true
systemd
:
name
:
libvirtd
state
:
started
-
name
:
stop firewalld
become
:
true
systemd
:
name
:
firewalld
state
:
stopped
when
:
"
ansible_distribution
==
'CentOS'"
-
name
:
flush forward table
become
:
true
iptables
:
chain
:
FORWARD
flush
:
true
-
name
:
iptables save
shell
:
'
sudo
iptables-save
>
~/ipt'
-
name
:
iptables forward script
copy
:
src
:
files/hypervisor/iptables-forward.sh
dest
:
'
~/iptables-forward.sh'
mode
:
0755
-
name
:
permission for home path
become
:
true
file
:
path
:
'
{{home_path}}'
state
:
directory
owner
:
'
{{ansible_user_id}}'
group
:
'
{{ansible_user_id}}'
-
name
:
pool directories
file
:
path
:
'
{{home_path}}/{{item}}'
state
:
directory
with_items
:
-
iso
-
img
init.yml
View file @
cb509814
...
...
@@ -141,7 +141,7 @@
become
:
true
yum
:
state
:
latest
name
:
curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,xclip,traceroute,tar,unzip,iperf,nmap
# astyle
name
:
curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,xclip,traceroute,tar,unzip,iperf,nmap
,libselinux-python
# astyle
when
:
"
ansible_distribution
==
'CentOS'
and
ansible_distribution_major_version|int
==
7"
#- name: yum autoremove
# become: true
...
...
@@ -158,13 +158,18 @@
become
:
true
dnf
:
state
:
latest
name
:
curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,astyle,traceroute,tar,unzip,nmap
# xclip
name
:
curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,astyle,traceroute,tar,unzip,nmap
,python3-libselinux
# xclip
when
:
"
ansible_distribution
==
'CentOS'
and
ansible_distribution_major_version|int
==
8"
-
name
:
dnf autoremove
become
:
true
dnf
:
autoremove
:
true
when
:
"
ansible_distribution
==
'CentOS'
and
ansible_distribution_major_version|int
==
8"
-
name
:
disable selinux
become
:
true
selinux
:
state
:
disabled
when
:
"
ansible_distribution
==
'CentOS'"
-
name
:
vim
unarchive
:
src
:
https://minio.mycard.moe:9000/nanahira/nanahira-vim.tar.gz
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment