Update installer for virtualbox/ubuntu-jammy

This patch is to fix a lack of required packages for building devstack
environment and drop old focal support.

* Add pip installation of pbr for ovn-metadata agent and netaddr for
  kuryr-kubernetes.

* Remove boxes and playbooks for focal.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: Ie345e50e09a3236d0c2ab9ff1494058bdc6c010b
This commit is contained in:
Yasufumi Ogawa 2023-11-09 14:26:50 +09:00
parent 6ea1c1e8da
commit 04d2c197d9
25 changed files with 12 additions and 499 deletions

View File

@ -30,16 +30,6 @@ environment.
$ 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

View File

@ -23,16 +23,16 @@ machines = Machines.new(vd_config["machines"])
# 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"],
"ubuntu" => ["bento/ubuntu-22.04", "generic/ubuntu2204"],
"centos" => ["bento/centos-stream-8", "centos/stream8"]
},
#"libvirt" => {
# "ubuntu" => ["generic/ubuntu2204", "generic/ubuntu2004"],
# "ubuntu" => ["bento/ubuntu-22.04", "generic/ubuntu2204"],
# "centos" => ["generic/centos9s", "generic/centos8s"]
#}
}
lvm_boxes = ["bento/ubuntu-20.04", "bento/ubuntu-22.04"]
lvm_boxes = ["bento/ubuntu-22.04"]
Vagrant.configure("2") do |config|

View File

@ -4,12 +4,6 @@
[ubuntu-jammy.compute]
#192.168.56.12
[ubuntu-focal.controller]
#192.168.56.13
[ubuntu-focal.compute]
#192.168.56.14
[centos-stream8.controller]
#192.168.56.15

View File

@ -7,7 +7,7 @@ class Machines < Array
:private_ips, :public_ips, :ssh_forward_x11, :fwd_port_list
def initialize(
hostname="controller", provider="virtualbox", box="ubuntu/focal64",
hostname="controller", provider="virtualbox", box="bento/ubuntu-22.04",
nof_cpus=2, mem_size=4, disk_size=10,
private_ips=["192.168.56.11"], public_ips=nil, ssh_forward_x11=false,
fwd_port_list=nil)

View File

@ -1,13 +0,0 @@
boxes:
ubuntu:
"20.04":
virtualbox: ubuntu/focal64
"18.04":
virtualbox: ubuntu/bionic64
libvirt: generic/ubuntu1804
"16.04":
virtualbox: ubuntu/xenial64
libvirt: yk0/ubuntu-xenial
centos:
stream8:
virtualbox: centos/stream8

View File

@ -1,6 +0,0 @@
---
- name: install basic packages
become: yes
apt: name={{ item }} update_cache=yes
with_items:
- git

View File

@ -1,15 +0,0 @@
---
- 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

View File

@ -1,6 +0,0 @@
---
- include: basic_pkgs.yml
tags: basic_pkgs
- include: devstack.yml
tags: devstack

View File

@ -1,22 +0,0 @@
[[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

View File

@ -1,26 +0,0 @@
---
- name: install python and libs
become: yes
apt: name={{ item }} update_cache=yes
with_items:
- python3
- python3-dev
- python3-pip
- name: install git tools
become: yes
apt: name={{ item }}
with_items:
- git
- git-review
- name: install networking tools
become: yes
apt: name={{ item }}
with_items:
- bridge-utils
- name: upgrade apt packages
become: yes
apt:
upgrade: safe

View File

@ -1,20 +0,0 @@
---
- 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

View File

@ -1,8 +0,0 @@
---
- name: install extra packages
become: yes
apt: name={{ item }}
with_items:
- jq
- htop
- lnav

View File

@ -1,4 +0,0 @@
---
- name: copy .gitconfig on host to VM
template: src=templates/gitconfig.j2 dest={{ ansible_env.HOME }}/.gitconfig
mode=664

View File

@ -1,26 +0,0 @@
---
# 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: neovim.yml
when: use_neovim == true
- include: devstack.yml
- include: setup_tacker.yml
when: use_tacker == true
- include: extra_tools.yml
when: use_extra_tools == true

View File

@ -1,22 +0,0 @@
---
- name: install neovim
become: yes
unarchive:
src=https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz
dest=/usr/local
remote_src=yes
- name: set PATH for '.local/bin'
lineinfile:
line="export PATH=/usr/local/nvim-linux64/bin:$PATH"
dest={{ ansible_env.HOME }}/.bashrc
- name: install latest nodejs for nvim coc
become: yes
shell: curl -sL install-node.vercel.app | sudo bash -s -- --yes
- name: install latest yarn for nvim coc
become: yes
npm:
name: yarn
global: yes

View File

@ -1,9 +0,0 @@
---
- name: install python3 other than default version
become: yes
apt: name={{ item }}
with_items:
- python3.8
- python3.8-dev
- python3.9
- python3.9-dev

View File

@ -1,11 +0,0 @@
---
- name: remove useless python3-launchpadlib
become: yes
apt:
name: python3-launchpadlib
state: absent
- name: cleanup with autoremove
become: yes
apt:
autoremove: yes

View File

@ -1,5 +0,0 @@
---
- name: set PATH for '.local/bin'
lineinfile:
line="export PATH=$HOME/.local/bin:$PATH:/sbin"
dest={{ ansible_env.HOME }}/.bashrc

View File

@ -1,65 +0,0 @@
---
- 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

View File

@ -1,29 +0,0 @@
---
- 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]

View File

@ -1,8 +0,0 @@
---
- name: add apt repo ppa:jonathonf/vim
become: yes
apt_repository: repo='ppa:jonathonf/vim'
- name: install vim
become: yes
apt: name=vim

View File

@ -1,159 +0,0 @@
" 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

View File

@ -10,11 +10,12 @@
repo=https://opendev.org/openstack/devstack.git
dest={{ ansible_env.HOME }}/devstack
- name: install os-testr
pip:
name: os-testr
state: latest
- name: install required packages for openstack
become: yes
pip: name={{ item }}
with_items:
- os-testr
- tox
- netaddr
- pbr
- name: install tox
pip:
name: tox

View File

@ -37,12 +37,6 @@
- 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

View File

@ -11,18 +11,6 @@
roles:
- ubuntu-jammy/compute
- name: ubuntu-focal controller node
hosts: ubuntu-focal.controller
remote_user: stack
roles:
- ubuntu-focal/controller
- name: ubuntu-focal compute nodes
hosts: ubuntu-focal.compute
remote_user: stack
roles:
- ubuntu-focal/compute
- name: centos-stream8 controller node
hosts: centos-stream8.controller
remote_user: stack