From a504eeef331e6682c3c225befeb6473c6d296045 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 23 Mar 2023 21:40:54 -0500 Subject: [PATCH] slight restructuring --- salt/Vagrantfile => Vagrantfile | 32 ++++++++++++++++++++++++++++---- srv/salt/vim.sls | 10 ++++++++++ srv/salt/vimrc | 18 ++++++++++++++++++ 3 files changed, 56 insertions(+), 4 deletions(-) rename salt/Vagrantfile => Vagrantfile (80%) create mode 100644 srv/salt/vim.sls create mode 100644 srv/salt/vimrc diff --git a/salt/Vagrantfile b/Vagrantfile similarity index 80% rename from salt/Vagrantfile rename to Vagrantfile index 57bf9af..a6f5995 100644 --- a/salt/Vagrantfile +++ b/Vagrantfile @@ -13,6 +13,7 @@ Vagrant.configure("2") do |config| salt.vm.provider :libvirt do |libvirt| libvirt.memory = 1024 end + salt.vm.synced_folder 'srv', '/srv', type: 'rsync' salt.vm.provision "shell", inline: <<-SHELL apt-get update apt-get install curl vim -y @@ -31,9 +32,15 @@ Vagrant.configure("2") do |config| minion01.vm.network "private_network", ip: "192.168.100.121" minion01.vm.provision "shell", inline: <<-SHELL apt-get update - apt-get install curl vim -y + apt-get install curl -y curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io sh bootstrap-salt.sh -A 192.168.100.120 + cat << EOF > /etc/salt/minion.d/grains.conf +grains: + roles: + - saltlab +EOF + systemctl restart salt-minion SHELL end config.vm.define "minion02" do |minion02| @@ -42,9 +49,15 @@ Vagrant.configure("2") do |config| minion02.vm.network "private_network", ip: "192.168.100.122" minion02.vm.provision "shell", inline: <<-SHELL apt-get update - apt-get install curl vim -y + apt-get install curl -y curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io sh bootstrap-salt.sh -A 192.168.100.120 + cat << EOF > /etc/salt/minion.d/grains.conf +grains: + roles: + - saltlab +EOF + systemctl restart salt-minion SHELL end config.vm.define "minion03" do |minion03| @@ -52,9 +65,14 @@ Vagrant.configure("2") do |config| minion03.vm.hostname = "minion03" minion03.vm.network "private_network", ip: "192.168.100.123" minion03.vm.provision "shell", inline: <<-SHELL - yum install vim -y curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io sh bootstrap-salt.sh -A 192.168.100.120 || sh bootstrap-salt.sh -A 192.168.100.120 + cat << EOF > /etc/salt/minion.d/grains.conf +grains: + roles: + - saltlab +EOF + systemctl restart salt-minion SHELL end config.vm.define "minion04" do |minion04| @@ -62,9 +80,15 @@ Vagrant.configure("2") do |config| minion04.vm.hostname = "minion04" minion04.vm.network "private_network", ip: "192.168.100.124" minion04.vm.provision "shell", inline: <<-SHELL - yum install vim -y + yum install -y curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io sh bootstrap-salt.sh -A 192.168.100.120 + cat << EOF > /etc/salt/minion.d/grains.conf +grains: + roles: + - saltlab +EOF + systemctl restart salt-minion SHELL end end diff --git a/srv/salt/vim.sls b/srv/salt/vim.sls new file mode 100644 index 0000000..2fa9efc --- /dev/null +++ b/srv/salt/vim.sls @@ -0,0 +1,10 @@ +vim: + pkg.installed: [] + +/etc/vimrc: + file.managed: + - source: salt://vimrc + - mode: 644 + - user: root + - group: root + diff --git a/srv/salt/vimrc b/srv/salt/vimrc new file mode 100644 index 0000000..eb7aac9 --- /dev/null +++ b/srv/salt/vimrc @@ -0,0 +1,18 @@ +" coding preferences +filetype off +filetype plugin indent on + +syntax on +set backspace=indent,eol,start +set noautoindent +set noswapfile +set number +set ruler +set showmatch +set smarttab +set ts=2 sw=2 sts=2 expandtab + +let mapleader="," +if has("autocmd") + autocmd FileType go set ts=2 sw=2 sts=2 noet nolist autowrite +endif