diff --git a/Vagrantfile b/Vagrantfile index 17e4f39ab..f2beb9119 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -47,16 +47,12 @@ def configure_machine(machine, idx, roles, memory, cpus) machine.vm.network :private_network, ip: "10.13.37.#{10 + idx}" #machine.vm.network "public_network", use_dhcp_assigned_default_route: true - machine.vm.provision "shell", path: "chef/suse-prepare.sh" - machine.vm.provision :chef_solo do |chef| - chef.version = "12.21.4" - chef.cookbooks_path = ["chef/cookbooks"] - chef.roles_path = ["chef/roles"] - chef.custom_config_path = "chef/solo.rb" - #chef.synced_folder_type = "rsync" - roles.each do |role| - chef.add_role role - end + machine.vm.provision :salt do |salt| + salt.minion_config = "salt/etc/minion" + salt.run_highstate = true + salt.install_type = "git" + salt.install_args = "v2017.7" + salt.verbose = true end machine.vm.provider :virtualbox do |provider, override| diff --git a/salt/etc/minion b/salt/etc/minion new file mode 100644 index 000000000..a22ff8009 --- /dev/null +++ b/salt/etc/minion @@ -0,0 +1,7 @@ +file_client: local +file_roots: + base: + - /vagrant/salt/salt +pillar_roots: + base: + - /vagrant/salt/pillar diff --git a/salt/salt/common/hosts.sls b/salt/salt/common/hosts.sls new file mode 100644 index 000000000..2bbb7efda --- /dev/null +++ b/salt/salt/common/hosts.sls @@ -0,0 +1,11 @@ +webui: + host.present: + - ip: 10.13.37.10 + +node1: + host.present: + - ip: 10.13.37.11 + +node2: + host.present: + - ip: 10.13.37.12 diff --git a/salt/salt/common/init.sls b/salt/salt/common/init.sls new file mode 100644 index 000000000..d8a2974d0 --- /dev/null +++ b/salt/salt/common/init.sls @@ -0,0 +1,6 @@ +include: + - common.packages + - common.ntp + - common.watchdog + - common.hosts + - common.ssh diff --git a/salt/salt/common/ntp.sls b/salt/salt/common/ntp.sls new file mode 100644 index 000000000..3d5aba520 --- /dev/null +++ b/salt/salt/common/ntp.sls @@ -0,0 +1,11 @@ +ntp_package: + pkg.installed: + - names: + - ntp + +ntpd: + service.running: + - enable: True + - require: + - pkg: ntp_package + diff --git a/salt/salt/common/packages.sls b/salt/salt/common/packages.sls new file mode 100644 index 000000000..eb14b46ab --- /dev/null +++ b/salt/salt/common/packages.sls @@ -0,0 +1,46 @@ +rubyext: + pkgrepo.managed: + - humanname: devel:languages:ruby:extensions + - baseurl: http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_Leap_42.3/ + - refresh: True + - gpgautoimport: True + +darix: + pkgrepo.managed: + - humanname: home:darix:apps + - baseurl: http://download.opensuse.org/repositories/home:/darix:/apps/openSUSE_Leap_42.3/ + - refresh: True + - gpgautoimport: True + +common_packages: + pkg.installed: + - names: + - ha-cluster-bootstrap + - fence-agents + - apache2 + - haproxy + - libglue-devel + - drbd + - drbd-utils + - nodejs8 + - ruby2.4-rubygem-rails-5.1 + - ruby2.4-rubygem-puma + - ruby2.4-rubygem-sass-rails-5_0 + - ruby2.4-rubygem-virtus + - ruby2.4-rubygem-js-routes + - ruby2.4-rubygem-tilt + - ruby2.4-rubygem-fast_gettext + - ruby2.4-rubygem-gettext_i18n_rails + - ruby2.4-rubygem-gettext_i18n_rails_js + - ruby2.4-rubygem-sprockets + - ruby2.4-rubygem-kramdown + - ruby2.4-rubygem-web-console + - ruby2.4-rubygem-spring + - ruby2.4-rubygem-uglifier + - ruby2.4-rubygem-gettext + - require: + - pkgrepo: darix + - pkgrepo: rubyext + + + diff --git a/salt/salt/common/ssh.sls b/salt/salt/common/ssh.sls new file mode 100644 index 000000000..cdd1b3c37 --- /dev/null +++ b/salt/salt/common/ssh.sls @@ -0,0 +1,23 @@ +vagrant_root: + ssh_auth.present: + - user: root + - source: salt://sshkeys/vagrant.pub + - config: '%h/.ssh/authorized_keys' + +vagrant_vagrant: + ssh_auth.present: + - user: vagrant + - source: salt://sshkeys/vagrant.pub + - config: '%h/.ssh/authorized_keys' + +krig_root: + ssh_auth.present: + - user: root + - source: salt://sshkeys/krig.pub + - config: '%h/.ssh/authorized_keys' + +krig_vagrant: + ssh_auth.present: + - user: vagrant + - source: salt://sshkeys/krig.pub + - config: '%h/.ssh/authorized_keys' diff --git a/salt/salt/common/watchdog.sls b/salt/salt/common/watchdog.sls new file mode 100644 index 000000000..bf5186332 --- /dev/null +++ b/salt/salt/common/watchdog.sls @@ -0,0 +1,4 @@ +setup_watchdog: + kmod.present: + - name: softdog + - persist: True diff --git a/salt/salt/sshkeys/krig.pub b/salt/salt/sshkeys/krig.pub new file mode 100644 index 000000000..62553ac26 --- /dev/null +++ b/salt/salt/sshkeys/krig.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzma1vLqNyJneb/AwLdvcJr9SeXaE3zPU7V9uVsAMcV9U0uCdWKBiyB8+0amd8kcfdqs0Wm5qh5hdCLTsJ+xL5N/DmnOK1cNkg5jwBbgfxJpb1DY617YuDJ6bWouwQfZCF/Kc2lhYpaq0POr+bdIQX5UpQH2bWuykarjlxUIG7GQSd8xs0FB9Uvmx/DM4tMoG8Vd8stT5tMFqWQ8af/yqPuAr9LfB98F3Rucr3rrPQpvEwCay95RoruNJcn19ZWhpi2tUSIrwnmxZHot7RpAg8EN+d/U0jWNiXeNEET3c5BrlcCXkSqzfjPaQNrIiuFNiy6gh9/XJpuU041tGuCJ/4Q== krig@fenris diff --git a/salt/salt/sshkeys/vagrant.pub b/salt/salt/sshkeys/vagrant.pub new file mode 100644 index 000000000..18a9c00fd --- /dev/null +++ b/salt/salt/sshkeys/vagrant.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key diff --git a/salt/salt/top.sls b/salt/salt/top.sls new file mode 100644 index 000000000..133c8072d --- /dev/null +++ b/salt/salt/top.sls @@ -0,0 +1,3 @@ +base: + '*': + - common