Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.4"
config.vm.hostname = "co74mosquitto"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co74mosquitto"
vbox.cpus = 2
vbox.memory = 1024
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.108", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.108", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
# install mosquitto
yum -y install epel-release
yum -y install mosquitto
systemctl enable mosquitto
systemctl start mosquitto
# execute commands for test.
mosquitto_sub -t mytopic/test -h co74mosquitto >> /tmp/sample.txt 2>&1 &
mosquitto_pub -t mytopic/test -h co74mosquitto -m "test message."
sleep 10
cat /tmp/sample.txt
SHELL
end
○関連情報
・mosquittoに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿