From 92e5e164a616e090e94e51f65f8833137478f3f6 Mon Sep 17 00:00:00 2001 From: Yasufumi Ogawa Date: Fri, 7 Feb 2025 22:49:50 +0900 Subject: [PATCH] Update tacker installer for Ubuntu 24.04 * Update supported ubuntu version to 24.04. * Replace pip with pipx since the recent pip doesn't allow system-wide installation of packages for PEP668. * Drop centos-stream8 support. Change-Id: I57334595f7dd005ff51dd3cd3c605b4b30ce7efa --- vagrant/devstack/Vagrantfile | 42 +---- vagrant/devstack/hosts | 10 +- vagrant/devstack/lib/machine.rb | 2 +- vagrant/devstack/lib/vd_utils.rb | 2 +- .../compute/templates/local.conf.j2 | 22 --- .../controller/tasks/basic_pkgs.yml | 14 -- .../controller/tasks/devstack.yml | 22 --- .../controller/tasks/extra_tools.yml | 6 - .../controller/tasks/kubernetes.yml | 10 -- .../centos-stream8/controller/tasks/main.yml | 21 --- .../centos-stream8/controller/tasks/ovn.yml | 24 --- .../tasks/python3_specific_vers.yml | 9 - .../controller/tasks/setup_tacker.yml | 65 ------- .../controller/tasks/vim_extra_plugins.yml | 35 ---- .../controller/templates/kubernetes.repo.j2 | 7 - .../roles/ubuntu-jammy/compute/tasks/main.yml | 6 - .../controller/tasks/git_config.yml | 4 - .../controller/tasks/set_path_env.yml | 5 - .../controller/templates/vimrc.j2 | 159 ------------------ .../compute/tasks/basic_pkgs.yml | 0 .../compute/tasks/devstack.yml | 0 .../compute/tasks/main.yml | 0 .../compute/templates/local.conf.j2 | 0 .../controller/tasks/basic_pkgs.yml | 1 + .../controller/tasks/devstack.yml | 3 +- .../controller/tasks/extra_tools.yml | 0 .../controller/tasks/git_config.yml | 0 .../controller/tasks/main.yml | 0 .../controller/tasks/neovim.yml | 4 +- .../tasks/python3_specific_vers.yml | 0 .../controller/tasks/remove_useless_pkgs.yml | 0 .../controller/tasks/set_path_env.yml | 0 .../controller/tasks/setup_tacker.yml | 0 .../controller/tasks/vim_extra_plugins.yml | 0 .../controller/tasks/vim_latest.yml | 0 .../controller/templates/vimrc.j2 | 0 vagrant/devstack/site.yaml | 18 +- 37 files changed, 17 insertions(+), 474 deletions(-) delete mode 100644 vagrant/devstack/roles/centos-stream8/compute/templates/local.conf.j2 delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/basic_pkgs.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/devstack.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/extra_tools.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/kubernetes.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/main.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/ovn.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/python3_specific_vers.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/setup_tacker.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/tasks/vim_extra_plugins.yml delete mode 100644 vagrant/devstack/roles/centos-stream8/controller/templates/kubernetes.repo.j2 delete mode 100644 vagrant/devstack/roles/ubuntu-jammy/compute/tasks/main.yml delete mode 100644 vagrant/devstack/roles/ubuntu-jammy/controller/tasks/git_config.yml delete mode 100644 vagrant/devstack/roles/ubuntu-jammy/controller/tasks/set_path_env.yml delete mode 100644 vagrant/devstack/roles/ubuntu-jammy/controller/templates/vimrc.j2 rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/compute/tasks/basic_pkgs.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/compute/tasks/devstack.yml (100%) rename vagrant/devstack/roles/{centos-stream8 => ubuntu-noble}/compute/tasks/main.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/compute/templates/local.conf.j2 (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/basic_pkgs.yml (97%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/devstack.yml (89%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/extra_tools.yml (100%) rename vagrant/devstack/roles/{centos-stream8 => ubuntu-noble}/controller/tasks/git_config.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/main.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/neovim.yml (83%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/python3_specific_vers.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/remove_useless_pkgs.yml (100%) rename vagrant/devstack/roles/{centos-stream8 => ubuntu-noble}/controller/tasks/set_path_env.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/setup_tacker.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/vim_extra_plugins.yml (100%) rename vagrant/devstack/roles/{ubuntu-jammy => ubuntu-noble}/controller/tasks/vim_latest.yml (100%) rename vagrant/devstack/roles/{centos-stream8 => ubuntu-noble}/controller/templates/vimrc.j2 (100%) diff --git a/vagrant/devstack/Vagrantfile b/vagrant/devstack/Vagrantfile index d8ad8eb58..e7ad6e498 100644 --- a/vagrant/devstack/Vagrantfile +++ b/vagrant/devstack/Vagrantfile @@ -23,16 +23,11 @@ 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-22.04", "generic/ubuntu2204"], - "centos" => ["bento/centos-stream-8", "centos/stream8"] - }, - #"libvirt" => { - # "ubuntu" => ["bento/ubuntu-22.04", "generic/ubuntu2204"], - # "centos" => ["generic/centos9s", "generic/centos8s"] - #} + "ubuntu" => ["bento/ubuntu-24.04", "generic/ubuntu2404"] + } } -lvm_boxes = ["bento/ubuntu-22.04"] +lvm_boxes = ["bento/ubuntu-24.04"] Vagrant.configure("2") do |config| @@ -108,11 +103,6 @@ Vagrant.configure("2") do |config| useradd -s /bin/bash -d /opt/stack -m stack echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack - # Permission of `stack` directory is 0700 on CentOS 8, but it cause an - # error in a sanity check for the permission while running devstack - # installatino. - chmod 755 /opt/stack - mkdir -p /opt/stack/.ssh echo "#{ssh_pub_key}" >> /opt/stack/.ssh/authorized_keys chown -R stack:stack /opt/stack/.ssh @@ -129,32 +119,6 @@ Vagrant.configure("2") do |config| 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 < 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 ; -nnoremap :NERDTreeToggle -" 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 :LspDefinition - nnoremap :LspHover - "nnoremap - nnoremap d :LspDefinition - nnoremap r :LspReferences - nnoremap t :LspTypeDefinition - nnoremap s :LspDocumentSymbol - nnoremap S :LspWorkspaceSymbol - nnoremap f :LspDocumentFormat - vnoremap f :LspDocumentRangeFormat - nnoremap h :LspHover - nnoremap i :LspImplementation - nnoremap e :LspNextError - nnoremap E :LspPreviousError - nnoremap N :LspRename -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 diff --git a/vagrant/devstack/roles/ubuntu-jammy/compute/tasks/basic_pkgs.yml b/vagrant/devstack/roles/ubuntu-noble/compute/tasks/basic_pkgs.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/compute/tasks/basic_pkgs.yml rename to vagrant/devstack/roles/ubuntu-noble/compute/tasks/basic_pkgs.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/compute/tasks/devstack.yml b/vagrant/devstack/roles/ubuntu-noble/compute/tasks/devstack.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/compute/tasks/devstack.yml rename to vagrant/devstack/roles/ubuntu-noble/compute/tasks/devstack.yml diff --git a/vagrant/devstack/roles/centos-stream8/compute/tasks/main.yml b/vagrant/devstack/roles/ubuntu-noble/compute/tasks/main.yml similarity index 100% rename from vagrant/devstack/roles/centos-stream8/compute/tasks/main.yml rename to vagrant/devstack/roles/ubuntu-noble/compute/tasks/main.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/compute/templates/local.conf.j2 b/vagrant/devstack/roles/ubuntu-noble/compute/templates/local.conf.j2 similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/compute/templates/local.conf.j2 rename to vagrant/devstack/roles/ubuntu-noble/compute/templates/local.conf.j2 diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/basic_pkgs.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/basic_pkgs.yml similarity index 97% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/basic_pkgs.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/basic_pkgs.yml index 93259033c..67146ff12 100644 --- a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/basic_pkgs.yml +++ b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/basic_pkgs.yml @@ -6,6 +6,7 @@ - python3 - python3-dev - python3-pip + - pipx - name: install git tools become: yes diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/devstack.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/devstack.yml similarity index 89% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/devstack.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/devstack.yml index b47e8a87e..f8904dcc5 100644 --- a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/devstack.yml +++ b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/devstack.yml @@ -11,8 +11,7 @@ dest={{ ansible_env.HOME }}/devstack - name: install required packages for openstack - become: yes - pip: name={{ item }} + community.general.pipx: name={{ item }} with_items: - os-testr - tox diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/extra_tools.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/extra_tools.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/extra_tools.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/extra_tools.yml diff --git a/vagrant/devstack/roles/centos-stream8/controller/tasks/git_config.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/git_config.yml similarity index 100% rename from vagrant/devstack/roles/centos-stream8/controller/tasks/git_config.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/git_config.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/main.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/main.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/main.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/main.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/neovim.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/neovim.yml similarity index 83% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/neovim.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/neovim.yml index 4ce9f4cea..976fea3b6 100644 --- a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/neovim.yml +++ b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/neovim.yml @@ -2,13 +2,13 @@ - name: install neovim become: yes unarchive: - src=https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz + src=https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.tar.gz dest=/usr/local remote_src=yes - name: set PATH for '.local/bin' lineinfile: - line="export PATH=/usr/local/nvim-linux64/bin:$PATH" + line="export PATH=/usr/local/nvim-linux-x86_64/bin:$PATH" dest={{ ansible_env.HOME }}/.bashrc - name: install latest nodejs for nvim coc diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/python3_specific_vers.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/python3_specific_vers.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/python3_specific_vers.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/python3_specific_vers.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/remove_useless_pkgs.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/remove_useless_pkgs.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/remove_useless_pkgs.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/remove_useless_pkgs.yml diff --git a/vagrant/devstack/roles/centos-stream8/controller/tasks/set_path_env.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/set_path_env.yml similarity index 100% rename from vagrant/devstack/roles/centos-stream8/controller/tasks/set_path_env.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/set_path_env.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/setup_tacker.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/setup_tacker.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/setup_tacker.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/setup_tacker.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/vim_extra_plugins.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/vim_extra_plugins.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/vim_extra_plugins.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/vim_extra_plugins.yml diff --git a/vagrant/devstack/roles/ubuntu-jammy/controller/tasks/vim_latest.yml b/vagrant/devstack/roles/ubuntu-noble/controller/tasks/vim_latest.yml similarity index 100% rename from vagrant/devstack/roles/ubuntu-jammy/controller/tasks/vim_latest.yml rename to vagrant/devstack/roles/ubuntu-noble/controller/tasks/vim_latest.yml diff --git a/vagrant/devstack/roles/centos-stream8/controller/templates/vimrc.j2 b/vagrant/devstack/roles/ubuntu-noble/controller/templates/vimrc.j2 similarity index 100% rename from vagrant/devstack/roles/centos-stream8/controller/templates/vimrc.j2 rename to vagrant/devstack/roles/ubuntu-noble/controller/templates/vimrc.j2 diff --git a/vagrant/devstack/site.yaml b/vagrant/devstack/site.yaml index 71fc6d839..449d26e2d 100644 --- a/vagrant/devstack/site.yaml +++ b/vagrant/devstack/site.yaml @@ -1,18 +1,12 @@ --- -- name: ubuntu-jammy controller node - hosts: ubuntu-jammy.controller +- name: ubuntu-noble controller node + hosts: ubuntu-noble.controller remote_user: stack roles: - - ubuntu-jammy/controller + - ubuntu-noble/controller -- name: ubuntu-jammy compute nodes - hosts: ubuntu-jammy.compute +- name: ubuntu-noble compute nodes + hosts: ubuntu-noble.compute remote_user: stack roles: - - ubuntu-jammy/compute - -- name: centos-stream8 controller node - hosts: centos-stream8.controller - remote_user: stack - roles: - - centos-stream8/controller + - ubuntu-noble/compute