Add jammy support for tacker installer
As one of the community-wide goals, devstack has shifted to Ubuntu Jammy from Antelope cycle [1]. So, add playbooks for Jammy to installer. Although Focal support is still remained so that you can setup your environment on older version, but will be removed later. There are some additional updates. * Add bento as supported boxes which are well maintained more. * Use experimental Vagrant Disk to expand disk space on logical volume because for Ubuntu images of bento. * Change to use ssh key in ed25519 instead of rsa because it was deprecated in Jammy as default. [1] https://lists.openstack.org/pipermail/openstack-discuss/2022-October/030845.html Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com> Change-Id: I65b209a8ff2bd46adf2a4ee507ef7eee099d1b13
This commit is contained in:
parent
46a28fc8a2
commit
6e72a2d376
@ -19,15 +19,27 @@ instructions on official sites for installation.
|
||||
* [vagrant](https://www.vagrantup.com/)
|
||||
* [ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
|
||||
|
||||
Before launching your VMs, you should should install plugin `vagrant-disksize`
|
||||
for expanding size of volume of VM. It is because the default size of box
|
||||
provided from Ubuntu, 10GB or so, is not enough for deploying devstack
|
||||
environment. It's required for expanding the volume size.
|
||||
Please also notice the version of vagrant supporting experimental feature
|
||||
[Vagrant Disks](https://developer.hashicorp.com/vagrant/docs/disks) for
|
||||
expanding the size of volume if you use Ubuntu box image.
|
||||
For other boxes than Ubuntu, plugin `vagrant-disksize` is required instead as
|
||||
below. It is because the default size is not enough for deploying OpenStack
|
||||
environment.
|
||||
|
||||
```sh
|
||||
$ vagrant plugin install vagrant-disksize
|
||||
```
|
||||
|
||||
Here is a list of current supported boxes in this tool.
|
||||
|
||||
* bento/ubuntu-22.04
|
||||
* bento/ubuntu-20.04
|
||||
* ubuntu/jammy64
|
||||
* ubuntu/focal64
|
||||
* bento/centos-stream-8
|
||||
* centos/stream8
|
||||
|
||||
|
||||
### Configure and Fire Up VMs
|
||||
|
||||
Before launching VMs with vagrant, configure `machines.yml`, which defines
|
||||
@ -42,8 +54,11 @@ $ YOUR_FAVORITE_EDITOR machines.yml
|
||||
You should take care about `private_ips` which is used in `hosts` for
|
||||
`ansible-playbook` as explained later.
|
||||
|
||||
You should confirm you have a SSH public key before you run vagrant. If your key
|
||||
is different from `~/.ssh/id_rsa.pub`, update `ssh_pub_key` in `machines.yml`.
|
||||
You should confirm you have a SSH key before you run the command. This tool
|
||||
expects the type of your key is not `rsa` but `ed25519` because `rsa`
|
||||
was deprecated as default in Ubuntu 22.04.
|
||||
Update key path `ssh_pub_key` in `machines.yml` without your key is
|
||||
`~/.ssh/id_ed25519.pub`.
|
||||
|
||||
Run `vagrant up` after configurations are done. It launches VMs and create a
|
||||
user `stack` on them.
|
||||
|
99
vagrant/devstack/Vagrantfile
vendored
99
vagrant/devstack/Vagrantfile
vendored
@ -10,32 +10,38 @@ require "yaml"
|
||||
load "lib/machine.rb"
|
||||
load "lib/vd_utils.rb"
|
||||
|
||||
if not VdUtils.vagrant_experimentals.include?("disks")
|
||||
ENV["VAGRANT_EXPERIMENTAL"] =
|
||||
VdUtils.vagrant_experimentals.append("disks").join(",")
|
||||
end
|
||||
|
||||
vd_config = YAML.load(open("machines.yml"))
|
||||
|
||||
ssh_pub_key = VdUtils.ssh_pub_key(vd_config)
|
||||
machines = Machines.new(vd_config["machines"])
|
||||
|
||||
# Check if you have already downloaded target box.
|
||||
box_list = []
|
||||
`vagrant box list`.each_line {|l|
|
||||
box_list << l.split(" ")[0]
|
||||
# TODO(yasufum) Test libvirt's boxes can be deployed haven't been tested yet.
|
||||
supported_boxes = {
|
||||
"virtualbox" => {
|
||||
"ubuntu" => ["bento/ubuntu-20.04", "bento/ubuntu-22.04", "ubuntu/focal64", "ubuntu/jammy64"],
|
||||
"centos" => ["bento/centos-stream-8", "centos/stream8"]
|
||||
},
|
||||
#"libvirt" => {
|
||||
# "ubuntu" => ["generic/ubuntu2204", "generic/ubuntu2004"],
|
||||
# "centos" => ["generic/centos9s", "generic/centos8s"]
|
||||
#}
|
||||
}
|
||||
|
||||
# If you don't have the box, download it.
|
||||
machines.each do |m|
|
||||
if not (box_list.include? m.box)
|
||||
puts "There is no box '#{m.box}' for '#{m.provider}'"
|
||||
puts "Run 'vagrant box add #{m.box}' first"
|
||||
end
|
||||
end
|
||||
lvm_boxes = ["bento/ubuntu-20.04", "bento/ubuntu-22.04"]
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
|
||||
machines.each do |machine|
|
||||
config.vm.define machine.hostname do |server|
|
||||
server.vm.box = machine.box
|
||||
server.vm.hostname = machine.hostname
|
||||
|
||||
# server.vm.box_check_update = false
|
||||
#server.vm.box_check_update = false
|
||||
|
||||
machine.private_ips.each do |ipaddr|
|
||||
server.vm.network "private_network", ip: ipaddr
|
||||
@ -66,19 +72,20 @@ Vagrant.configure("2") do |config|
|
||||
end
|
||||
end
|
||||
|
||||
if Vagrant.has_plugin?("vagrant-disksize")
|
||||
server.disksize.size = "#{machine.disk_size}GB"
|
||||
end
|
||||
|
||||
# TODO(yasufum) This configuration reported in [1] is required to avoid
|
||||
# timeout for ssh login to focal64 because of setting up public key in the
|
||||
# VM. This issue is only happened on focal, and not for bionic and xenial.
|
||||
# Remove this config after the problem is fixed in the focal image.
|
||||
# [1] https://bugs.launchpad.net/cloud-images/+bug/1829625
|
||||
if machine.box == "ubuntu/focal64"
|
||||
server.vm.provider 'virtualbox' do |v|
|
||||
v.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
|
||||
v.customize ["modifyvm", :id, "--uartmode1", "file", "./ttyS0.log"]
|
||||
# Expand disk size for some images have not enough disk space.
|
||||
# NOTE: Two scenarios are expected, having logical volumes or not.
|
||||
# For lvm case, add a virtual disk with an experimental feature first,
|
||||
# create a logical volume then while provisioning later.
|
||||
# Add a virtual disk has arbitrary name.
|
||||
# TODO(yasufum): Fix the total amount of disk size will be over
|
||||
# `machine.disk_size` GB unexpectedly.
|
||||
if (VdUtils.is_disks_enabled(machine.provider) and
|
||||
lvm_boxes.include?(machine.box) and
|
||||
supported_boxes["virtualbox"]["ubuntu"].include?(machine.box))
|
||||
server.vm.disk :disk, size: "#{machine.disk_size}GB", name: "mydrive"
|
||||
else # Not a case using lvm for which just resizing.
|
||||
if Vagrant.has_plugin?("vagrant-disksize")
|
||||
server.disksize.size = "#{machine.disk_size}GB"
|
||||
end
|
||||
end
|
||||
|
||||
@ -96,8 +103,7 @@ Vagrant.configure("2") do |config|
|
||||
vb.memory = "#{machine.mem_size * 1024}"
|
||||
end
|
||||
|
||||
# NOTE: remove `python3-launchpadlib` which causes many warinings, and
|
||||
# run autoremove to clean related packages.
|
||||
# Add stack user and register ssh key for direct login with.
|
||||
server.vm.provision "shell", inline: <<-SHELL
|
||||
useradd -s /bin/bash -d /opt/stack -m stack
|
||||
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
|
||||
@ -112,6 +118,45 @@ Vagrant.configure("2") do |config|
|
||||
chown -R stack:stack /opt/stack/.ssh
|
||||
SHELL
|
||||
|
||||
# Expand disk space.
|
||||
# NOTE: The name of devices and volumes are depend on the box images.
|
||||
if (VdUtils.is_disks_enabled(machine.provider) and
|
||||
lvm_boxes.include?(machine.box) and
|
||||
supported_boxes["virtualbox"]["ubuntu"].include?(machine.box))
|
||||
server.vm.provision "shell", inline: <<-SHELL
|
||||
pvcreate /dev/sdb
|
||||
vgextend ubuntu-vg /dev/sdb
|
||||
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
|
||||
resize2fs /dev/ubuntu-vg/ubuntu-lv
|
||||
SHELL
|
||||
elsif supported_boxes["virtualbox"]["centos"].include?(machine.box)
|
||||
# Use `parted` and `xfs_growfs` to expand disk space after resizing
|
||||
# volume.
|
||||
# NOTE: Decide partition number which is different on each box first.
|
||||
if machine.box == "bento/centos-stream-8"
|
||||
part_num = 2
|
||||
elsif machine.box == "centos/stream8"
|
||||
part_num = 1
|
||||
end
|
||||
|
||||
# NOTE: It doesn't use `parted` with --script option but here doc for
|
||||
# interactive mode. It's because `resizepart` of `parted` doesn't work
|
||||
# in non-interactive mode for some bug.
|
||||
server.vm.provision "shell", inline: <<-SHELL
|
||||
parted /dev/sda ---pretend-input-tty <<EOF
|
||||
resizepart
|
||||
#{part_num}
|
||||
Yes
|
||||
100%
|
||||
quit
|
||||
EOF
|
||||
SHELL
|
||||
|
||||
server.vm.provision "shell", inline: <<-SHELL
|
||||
xfs_growfs /dev/sda#{part_num}
|
||||
SHELL
|
||||
end
|
||||
|
||||
VdUtils.setup_git_config
|
||||
VdUtils.setup_ssh_config(vd_config)
|
||||
end
|
||||
|
@ -1,9 +1,17 @@
|
||||
[ubuntu-focal.controller]
|
||||
[ubuntu-jammy.controller]
|
||||
192.168.56.11
|
||||
|
||||
[ubuntu-focal.compute]
|
||||
[ubuntu-jammy.compute]
|
||||
#192.168.56.12
|
||||
|
||||
[ubuntu-focal.controller]
|
||||
#192.168.56.13
|
||||
|
||||
[centos-stream8.controller]
|
||||
[ubuntu-focal.compute]
|
||||
#192.168.56.14
|
||||
|
||||
[centos-stream8.controller]
|
||||
#192.168.56.15
|
||||
|
||||
[centos-stream8.compute]
|
||||
#192.168.56.16
|
||||
|
@ -6,7 +6,7 @@ module VdUtils
|
||||
|
||||
# Get the contents of SSH public key to upload it to VMs.
|
||||
def ssh_pub_key(config)
|
||||
default_key_path = "~/.ssh/id_rsa.pub"
|
||||
default_key_path = "~/.ssh/id_ed25519.pub"
|
||||
|
||||
if config["global"] != nil
|
||||
if config["global"]["ssh_pub_key"]
|
||||
@ -75,5 +75,27 @@ module VdUtils
|
||||
end
|
||||
end
|
||||
|
||||
module_function :ssh_pub_key, :setup_git_config, :setup_ssh_config
|
||||
# Return vagrant experimental features as a list.
|
||||
def vagrant_experimentals()
|
||||
res = []
|
||||
if ENV["VAGRANT_EXPERIMENTAL"]
|
||||
res = ENV["VAGRANT_EXPERIMENTAL"].split(",")
|
||||
end
|
||||
res
|
||||
end
|
||||
|
||||
# Experimental feature "disks" can be enabled only for virtualbox provider and
|
||||
# included in VAGRANT_EXPERIMENTAL env variable.
|
||||
def is_disks_enabled(provider)
|
||||
if provider == "virtualbox"
|
||||
if vagrant_experimentals().include? "disks"
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
module_function :ssh_pub_key, :setup_git_config, :setup_ssh_config,
|
||||
:vagrant_experimentals, :is_disks_enabled
|
||||
|
||||
end
|
||||
|
@ -6,7 +6,7 @@
|
||||
get_url: url=https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
dest={{ ansible_env.HOME }}/.vim/autoload/plug.vim
|
||||
|
||||
- name: vimrc
|
||||
- name: upload vimrc
|
||||
template: src=templates/vimrc.j2 dest={{ ansible_env.HOME }}/.vimrc
|
||||
mode=664
|
||||
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install basic packages
|
||||
become: yes
|
||||
apt: name={{ item }} update_cache=yes
|
||||
with_items:
|
||||
- git
|
@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: update git config
|
||||
git_config:
|
||||
scope: global
|
||||
name: 'url.https://.insteadOf'
|
||||
value: 'git://'
|
||||
|
||||
- name: git clone devstack
|
||||
git:
|
||||
repo=https://opendev.org/openstack/devstack.git
|
||||
dest={{ ansible_env.HOME }}/devstack
|
||||
|
||||
- name: put local.conf
|
||||
template: src=templates/local.conf.j2 dest={{ ansible_env.HOME }}/devstack/local.conf
|
||||
mode=665
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
- include: basic_pkgs.yml
|
||||
tags: basic_pkgs
|
||||
|
||||
- include: devstack.yml
|
||||
tags: devstack
|
@ -0,0 +1,22 @@
|
||||
[[local|localrc]]
|
||||
HOST_IP={{ ansible_host }}
|
||||
FIXED_RANGE={{ fixed_range }}
|
||||
FLOATING_RANGE={{ floating_range }}
|
||||
LOGFILE=/opt/stack/logs/stack.sh.log
|
||||
|
||||
ADMIN_PASSWORD={{ admin_password }}
|
||||
DATABASE_PASSWORD={{ database_password }}
|
||||
RABBIT_PASSWORD={{ rabbit_password }}
|
||||
SERVICE_PASSWORD={{ service_password }}
|
||||
|
||||
DATABASE_TYPE=mysql
|
||||
SERVICE_HOST={{ service_host }}
|
||||
MYSQL_HOST=$SERVICE_HOST
|
||||
RABBIT_HOST=$SERVICE_HOST
|
||||
GLANCE_HOSTPORT=$SERVICE_HOST:9292
|
||||
|
||||
ENABLED_SERVICES=n-cpu,c-vol,placement-client
|
||||
NOVA_VNC_ENABLED=True
|
||||
NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_lite.html"
|
||||
VNCSERVER_LISTEN=$HOST_IP
|
||||
VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN
|
@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: install basic packages
|
||||
become: yes
|
||||
apt: name={{ item }} update_cache=yes
|
||||
with_items:
|
||||
- python3
|
||||
- python3-dev
|
||||
- python3-pip
|
||||
- bridge-utils
|
||||
- git
|
||||
- git-review
|
||||
|
||||
- name: upgrade apt packages
|
||||
become: yes
|
||||
apt:
|
||||
upgrade: safe
|
@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: update git config
|
||||
git_config:
|
||||
scope: global
|
||||
name: 'url.https://.insteadOf'
|
||||
value: 'git://'
|
||||
|
||||
- name: git clone devstack
|
||||
git:
|
||||
repo=https://opendev.org/openstack/devstack.git
|
||||
dest={{ ansible_env.HOME }}/devstack
|
||||
|
||||
- name: install os-testr
|
||||
pip:
|
||||
name: os-testr
|
||||
state: latest
|
||||
|
||||
- name: install tox
|
||||
pip:
|
||||
name: tox
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: install extra packages
|
||||
become: yes
|
||||
apt: name={{ item }}
|
||||
with_items:
|
||||
- jq
|
||||
- htop
|
||||
- lnav
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
- name: copy .gitconfig on host to VM
|
||||
template: src=templates/gitconfig.j2 dest={{ ansible_env.HOME }}/.gitconfig
|
||||
mode=664
|
@ -0,0 +1,23 @@
|
||||
---
|
||||
# Without removing this package, failed to install while running scripts.
|
||||
- include: remove_useless_pkgs.yml
|
||||
|
||||
- include: basic_pkgs.yml
|
||||
- include: set_path_env.yml
|
||||
- include: git_config.yml
|
||||
|
||||
- include: python3_specific_vers.yml
|
||||
|
||||
- include: vim_latest.yml
|
||||
when: use_vim_latest == true
|
||||
|
||||
- include: vim_extra_plugins.yml
|
||||
when: use_vim_extra_plugins == true
|
||||
|
||||
- include: devstack.yml
|
||||
|
||||
- include: setup_tacker.yml
|
||||
when: use_tacker == true
|
||||
|
||||
- include: extra_tools.yml
|
||||
when: use_extra_tools == true
|
@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: install software-properties-common
|
||||
become: yes
|
||||
apt: name=software-properties-common
|
||||
environment: DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
- name: add apt repo ppa:deadsnakes/ppa
|
||||
become: yes
|
||||
apt_repository: repo='ppa:deadsnakes/ppa'
|
||||
|
||||
- name: install python3 other than default version
|
||||
become: yes
|
||||
apt: name={{ item }}
|
||||
with_items:
|
||||
- python3.9
|
||||
- python3.9-dev
|
@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: remove useless python3-launchpadlib
|
||||
become: yes
|
||||
apt:
|
||||
name: python3-launchpadlib
|
||||
state: absent
|
||||
|
||||
- name: cleanup with autoremove
|
||||
become: yes
|
||||
apt:
|
||||
autoremove: yes
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: set PATH for '.local/bin'
|
||||
lineinfile:
|
||||
line="export PATH=$HOME/.local/bin:$PATH:/sbin"
|
||||
dest={{ ansible_env.HOME }}/.bashrc
|
@ -0,0 +1,65 @@
|
||||
---
|
||||
- name: git clone tacker
|
||||
git:
|
||||
repo=https://opendev.org/openstack/tacker.git
|
||||
dest={{ ansible_env.HOME }}/tacker
|
||||
|
||||
- name: copy local.conf
|
||||
shell: cp {{ ansible_env.HOME }}/tacker/devstack/{{ item }} \
|
||||
{{ ansible_env.HOME }}/devstack/{{ item }}
|
||||
with_items:
|
||||
- local.conf.example
|
||||
- local.conf.kubernetes
|
||||
|
||||
- name: update HOST_IP in devstack/local.conf.example
|
||||
lineinfile:
|
||||
path={{ ansible_env.HOME }}/devstack/{{ item }}
|
||||
line='HOST_IP={{ ansible_host }}'
|
||||
regexp='^HOST_IP=127\.0\.0\.1'
|
||||
with_items:
|
||||
- local.conf.example
|
||||
- local.conf.kubernetes
|
||||
|
||||
- name: update other params in devstack/local.conf.example
|
||||
lineinfile:
|
||||
path={{ ansible_env.HOME }}/devstack/local.conf.example
|
||||
line={{ item.line }}
|
||||
regexp={{ item.regexp }}
|
||||
with_items:
|
||||
- line: 'ADMIN_PASSWORD={{ admin_password }}'
|
||||
regexp: '^ADMIN_PASSWORD=devstack'
|
||||
- line: 'MYSQL_PASSWORD={{ database_password }}'
|
||||
regexp: '^MYSQL_PASSWORD=devstack'
|
||||
- line: 'RABBIT_PASSWORD={{ rabbit_password }}'
|
||||
regexp: '^RABBIT_PASSWORD=devstack'
|
||||
- line: 'SERVICE_PASSWORD={{ service_password }}'
|
||||
regexp: '^SERVICE_PASSWORD=\$ADMIN_PASSWORD'
|
||||
- line: 'SERVICE_TOKEN={{ service_token }}'
|
||||
regexp: '^SERVICE_TOKEN=devstack'
|
||||
|
||||
- name: update HOST_IP in devstack/local.conf.kubernetes
|
||||
lineinfile:
|
||||
path={{ ansible_env.HOME }}/devstack/local.conf.kubernetes
|
||||
line='HOST_IP={{ service_host }}'
|
||||
regexp='^HOST_IP=127\.0\.0\.1'
|
||||
|
||||
- name: update other params in devstack/local.conf.kubernetes
|
||||
lineinfile:
|
||||
path={{ ansible_env.HOME }}/devstack/local.conf.kubernetes
|
||||
line={{ item.line }}
|
||||
regexp={{ item.regexp }}
|
||||
with_items:
|
||||
- line: 'ADMIN_PASSWORD={{ admin_password }}'
|
||||
regexp: '^ADMIN_PASSWORD=devstack'
|
||||
- line: 'MYSQL_PASSWORD={{ database_password }}'
|
||||
regexp: '^MYSQL_PASSWORD=devstack'
|
||||
- line: 'RABBIT_PASSWORD={{ rabbit_password }}'
|
||||
regexp: '^RABBIT_PASSWORD=devstack'
|
||||
- line: 'SERVICE_PASSWORD={{ service_password }}'
|
||||
regexp: '^SERVICE_PASSWORD=\$ADMIN_PASSWORD'
|
||||
- line: 'SERVICE_TOKEN={{ service_token }}'
|
||||
regexp: '^SERVICE_TOKEN=devstack'
|
||||
|
||||
- name: use local.conf.example as local.conf
|
||||
shell: cp {{ ansible_env.HOME }}/devstack/local.conf.example \
|
||||
{{ ansible_env.HOME }}/devstack/local.conf
|
@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: create dir for plug.vim
|
||||
file: path={{ ansible_env.HOME }}/.vim/autoload state=directory
|
||||
|
||||
- name: download plug.vim
|
||||
get_url: url=https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
dest={{ ansible_env.HOME }}/.vim/autoload/plug.vim
|
||||
|
||||
- name: upload vimrc
|
||||
template: src=templates/vimrc.j2 dest={{ ansible_env.HOME }}/.vimrc
|
||||
mode=664
|
||||
|
||||
- name: install exuberant-ctags
|
||||
become: yes
|
||||
apt: name=exuberant-ctags
|
||||
|
||||
- name: install npm
|
||||
become: yes
|
||||
apt: name=npm
|
||||
|
||||
- name: install bash-language-server
|
||||
become: yes
|
||||
npm:
|
||||
name: bash-language-server
|
||||
global: yes
|
||||
|
||||
- name: install python-language-server
|
||||
pip:
|
||||
name: python-language-server[all]
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: add apt repo ppa:jonathonf/vim
|
||||
become: yes
|
||||
apt_repository: repo='ppa:jonathonf/vim'
|
||||
|
||||
- name: install vim
|
||||
become: yes
|
||||
apt: name=vim
|
@ -0,0 +1,159 @@
|
||||
" Specify a directory for plugins
|
||||
" - For Neovim: stdpath('data') . '/plugged'
|
||||
" - Avoid using standard Vim directory names like 'plugin'
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
" Make sure you use single quotes
|
||||
|
||||
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
|
||||
Plug 'junegunn/vim-easy-align'
|
||||
|
||||
" Any valid git URL is allowed
|
||||
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
|
||||
|
||||
" Multiple Plug commands can be written in a single line using | separators
|
||||
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
|
||||
|
||||
" On-demand loading
|
||||
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
|
||||
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
||||
|
||||
" Using a non-master branch
|
||||
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
|
||||
|
||||
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
|
||||
"Plug 'fatih/vim-go', { 'tag': '*' }
|
||||
|
||||
" Plugin options
|
||||
"Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
|
||||
Plug 'nsf/gocode'
|
||||
|
||||
" Plugin outside ~/.vim/plugged with post-update hook
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
let g:fzf_command_prefix = 'Fzf'
|
||||
|
||||
" Unmanaged plugin (manually installed and updated)
|
||||
"Plug '~/my-prototype-plugin'
|
||||
|
||||
Plug 'tpope/vim-sensible'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'thinca/vim-quickrun'
|
||||
Plug 'ctrlpvim/ctrlp.vim'
|
||||
Plug 'flazz/vim-colorschemes'
|
||||
Plug 'thinca/vim-quickrun'
|
||||
|
||||
Plug 'jpo/vim-railscasts-theme'
|
||||
Plug 'godlygeek/tabular'
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
|
||||
Plug 'dense-analysis/ale'
|
||||
|
||||
Plug 'vim-scripts/taglist.vim'
|
||||
let Tlist_Use_Right_Window = 1
|
||||
|
||||
Plug 'prabirshrestha/async.vim'
|
||||
Plug 'prabirshrestha/vim-lsp'
|
||||
Plug 'prabirshrestha/asyncomplete.vim'
|
||||
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||
Plug 'natebosch/vim-lsc'
|
||||
Plug 'thomasfaingnaert/vim-lsp-snippets'
|
||||
Plug 'thomasfaingnaert/vim-lsp-ultisnips'
|
||||
let g:lsp_async_completion = 1
|
||||
|
||||
Plug 'tyru/current-func-info.vim'
|
||||
Plug 'yasufum/vim-os-unittestr'
|
||||
|
||||
" Initialize plugin system
|
||||
call plug#end()
|
||||
|
||||
syntax on
|
||||
set number
|
||||
set relativenumber
|
||||
set shiftwidth=4
|
||||
set tabstop=4
|
||||
set expandtab
|
||||
set showcmd
|
||||
set showmatch
|
||||
set hlsearch
|
||||
set laststatus=2
|
||||
set encoding=utf-8
|
||||
set fileencoding=utf-8
|
||||
set termencoding=utf-8
|
||||
set autoindent
|
||||
set scrolloff=4
|
||||
set smartcase
|
||||
set textwidth=80
|
||||
set colorcolumn=+1
|
||||
|
||||
set visualbell t_vb=
|
||||
set noerrorbells
|
||||
|
||||
set path+=**
|
||||
set wildmenu
|
||||
|
||||
colorscheme delek
|
||||
"colorscheme railscasts
|
||||
|
||||
autocmd FileType python set textwidth=79
|
||||
autocmd FileType gitcommit set textwidth=72
|
||||
|
||||
nnoremap ; <CR>
|
||||
nnoremap <C-n> :NERDTreeToggle<CR>
|
||||
" enable line numbers
|
||||
let NERDTreeShowLineNumbers=1
|
||||
" make sure relative line number is used
|
||||
autocmd FileType nerdtree setlocal relativenumber
|
||||
|
||||
""" Open vimrc from ':Conf' command.
|
||||
function! s:open_vimrc() abort
|
||||
new ~/.vimrc
|
||||
endfunction
|
||||
command! Conf call s:open_vimrc()
|
||||
|
||||
function! s:configure_lsp() abort
|
||||
setlocal omnifunc=lsp#complete
|
||||
nnoremap <buffer> <C-]> :<C-u>LspDefinition<CR>
|
||||
nnoremap <buffer> <C-h> :<C-u>LspHover<CR>
|
||||
"nnoremap <buffer> <C-@> <C-t>
|
||||
nnoremap <buffer> <C-l>d :<C-u>LspDefinition<CR>
|
||||
nnoremap <buffer> <C-l>r :<C-u>LspReferences<CR>
|
||||
nnoremap <buffer> <C-l>t :<C-u>LspTypeDefinition<CR>
|
||||
nnoremap <buffer> <C-l>s :<C-u>LspDocumentSymbol<CR>
|
||||
nnoremap <buffer> <C-l>S :<C-u>LspWorkspaceSymbol<CR>
|
||||
nnoremap <buffer> <C-l>f :<C-u>LspDocumentFormat<CR>
|
||||
vnoremap <buffer> <C-l>f :<C-u>LspDocumentRangeFormat<CR>
|
||||
nnoremap <buffer> <C-l>h :<C-u>LspHover<CR>
|
||||
nnoremap <buffer> <C-l>i :<C-u>LspImplementation<CR>
|
||||
nnoremap <buffer> <C-l>e :<C-u>LspNextError<CR>
|
||||
nnoremap <buffer> <C-l>E :<C-u>LspPreviousError<CR>
|
||||
nnoremap <buffer> <C-l>N :<C-u>LspRename<CR>
|
||||
endfunction
|
||||
|
||||
" Do ALE diagnostic
|
||||
let g:lsp_diagnostics_enabled = 0
|
||||
|
||||
if executable('pyls')
|
||||
autocmd User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'pyls',
|
||||
\ 'cmd': { server_info -> ['pyls'] },
|
||||
\ 'whitelist': ['python'],
|
||||
\ 'workspace_config': {'pyls': {'plugins': {
|
||||
\ 'pycodestyle': {'enabled': v:false},
|
||||
\ 'jedi_definition': {'follow_imports': v:true, 'follow_builtin_imports': v:true},}}}
|
||||
\})
|
||||
"autocmd BufWritePre *.py LspDocumentFormatSync
|
||||
autocmd FileType python call s:configure_lsp()
|
||||
endif
|
||||
|
||||
if executable('bash-language-server')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'bash-language-server',
|
||||
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'bash-language-server start']},
|
||||
\ 'whitelist': ['sh'],
|
||||
\ })
|
||||
"autocmd BufWritePre *.sh LspDocumentFormatSync
|
||||
autocmd FileType sh call s:configure_lsp()
|
||||
endif
|
@ -1,15 +1,16 @@
|
||||
global:
|
||||
# (optional) Path of your SSH public key. Default is "~/.ssh/id_rsa.pub".
|
||||
#ssh_pub_key: "~/.ssh/id_rsa.pub"
|
||||
# (optional) Path of your SSH public key. Default is "~/.ssh/id_ed25519.pub".
|
||||
#ssh_pub_key: "~/.ssh/id_ed25519.pub"
|
||||
|
||||
machines:
|
||||
|
||||
- hostname: controller
|
||||
provider: virtualbox
|
||||
box: ubuntu/focal64
|
||||
# Refer to the supported boxes in "Requirements" section in README.md
|
||||
box: bento/ubuntu-22.04
|
||||
nof_cpus: 4
|
||||
mem_size: 12
|
||||
disk_size: 50
|
||||
disk_size: 160
|
||||
private_ips:
|
||||
- 192.168.56.11
|
||||
public_ips:
|
||||
@ -19,10 +20,10 @@ machines:
|
||||
|
||||
- hostname: compute
|
||||
provider: virtualbox
|
||||
box: ubuntu/focal64
|
||||
box: bento/ubuntu-22.04
|
||||
nof_cpus: 4
|
||||
mem_size: 8
|
||||
disk_size: 50
|
||||
disk_size: 160
|
||||
private_ips:
|
||||
- 192.168.56.12
|
||||
public_ips:
|
||||
|
@ -1,16 +1,16 @@
|
||||
global:
|
||||
# (optional) Path of your SSH public key. Default is "~/.ssh/id_rsa.pub".
|
||||
#ssh_pub_key: "~/.ssh/id_rsa.pub"
|
||||
# (optional) Path of your SSH public key. Default is "~/.ssh/id_ed25519.pub".
|
||||
#ssh_pub_key: "~/.ssh/id_ed25519.pub"
|
||||
|
||||
machines:
|
||||
|
||||
- hostname: controller
|
||||
provider: virtualbox
|
||||
# Supported boxes are `ubuntu/focal64`, `centos/stream8`.
|
||||
box: ubuntu/focal64
|
||||
# Refer to the supported boxes in "Requirements" section in README.md
|
||||
box: bento/ubuntu-22.04
|
||||
nof_cpus: 4
|
||||
mem_size: 12
|
||||
disk_size: 50
|
||||
disk_size: 160
|
||||
private_ips:
|
||||
- 192.168.56.11
|
||||
public_ips:
|
||||
|
@ -1,4 +1,16 @@
|
||||
---
|
||||
- name: ubuntu-jammy controller node
|
||||
hosts: ubuntu-jammy.controller
|
||||
remote_user: stack
|
||||
roles:
|
||||
- ubuntu-jammy/controller
|
||||
|
||||
- name: ubuntu-jammy compute nodes
|
||||
hosts: ubuntu-jammy.compute
|
||||
remote_user: stack
|
||||
roles:
|
||||
- ubuntu-jammy/compute
|
||||
|
||||
- name: ubuntu-focal controller node
|
||||
hosts: ubuntu-focal.controller
|
||||
remote_user: stack
|
||||
|
Loading…
x
Reference in New Issue
Block a user