
Add machine charms in tests/all-k8s Deploy machine charms as part of configure Integrate cross model relations Remove excluded tempest smoke tests Increase func-test-all-k8s job to 1.5 hour Run func-test-all-k8s for changes in openstack-hypervisor, cinder-volume, cinder-volume-ceph charm. Other machine charms are not included as it did not seem fit to run the whole cloud for those charm changes. Remove functional tests core, caas, ceph, misc. Change-Id: I5e2d899c6bebbca4a9da9c0137ff65c7df076720 Signed-off-by: Hemanth Nakkina <hemanth.nakkina@canonical.com>
100 lines
2.9 KiB
YAML
100 lines
2.9 KiB
YAML
- name: Snapd is installed
|
|
ansible.builtin.apt:
|
|
name: snapd
|
|
become: true
|
|
|
|
- name: NFtables is installed
|
|
ansible.builtin.apt:
|
|
name: nftables
|
|
become: true
|
|
when:
|
|
- ansible_distribution_release in ('jammy', 'noble')
|
|
- nftables_enabled | default(true) | bool
|
|
|
|
- name: Increase fs.inotify.max_user_instances
|
|
ansible.posix.sysctl:
|
|
name: fs.inotify.max_user_instances
|
|
value: '4096'
|
|
sysctl_set: true
|
|
state: present
|
|
reload: true
|
|
become: true
|
|
|
|
- name: Allow packets from pod cir
|
|
ansible.builtin.command: nft insert rule filter openstack-INPUT ip saddr {{ k8s_pod_cidr }} accept
|
|
become: true
|
|
changed_when: false
|
|
when:
|
|
- ansible_distribution_release in ('jammy', 'noble')
|
|
- nftables_enabled | default(true) | bool
|
|
- insert_nft_rules | bool
|
|
|
|
- name: Allow packets to pod cir
|
|
ansible.builtin.command: nft insert rule filter openstack-INPUT ip daddr {{ k8s_pod_cidr }} accept
|
|
become: true
|
|
changed_when: false
|
|
when:
|
|
- ansible_distribution_release in ('jammy', 'noble')
|
|
- nftables_enabled | default(true) | bool
|
|
- insert_nft_rules | bool
|
|
|
|
- name: Allow packets to metallb cir
|
|
ansible.builtin.command: nft insert rule filter openstack-INPUT ip daddr {{ k8s_load_balancer_cidr }} accept
|
|
become: true
|
|
changed_when: false
|
|
when:
|
|
- ansible_distribution_release in ('jammy', 'noble')
|
|
- nftables_enabled | default(true) | bool
|
|
- insert_nft_rules | bool
|
|
|
|
- name: Ensure k8s is installed
|
|
community.general.snap:
|
|
name: k8s
|
|
channel: '{{ k8s_channel }}'
|
|
classic: '{{ k8s_classic_mode }}'
|
|
become: true
|
|
|
|
- name: Template docker.io registry
|
|
ansible.builtin.include_tasks: registry.yaml
|
|
when: docker_mirror is defined
|
|
vars:
|
|
reg_server_name: docker.io
|
|
reg_server: https://docker.io
|
|
reg_mirror_location: '{{ docker_mirror }}'
|
|
|
|
- name: Template k8s bootstrap configuration
|
|
ansible.builtin.template:
|
|
src: k8s-bootstrap.yaml.j2
|
|
dest: k8s-bootstrap.yaml
|
|
mode: '0644'
|
|
become: true
|
|
|
|
- name: Bootstrap k8s
|
|
ansible.builtin.command:
|
|
cmd: k8s bootstrap --file k8s-bootstrap.yaml --timeout 300s --address {{ k8s_host_ip }}
|
|
become: true
|
|
register: res
|
|
failed_when: res.rc != 0 and "already part of a cluster" not in res.stderr
|
|
changed_when: res.rc == 0 and "Bootstrapped a new Kubernetes cluster" in res.stdout
|
|
|
|
- name: Wait for k8s readiness
|
|
ansible.builtin.command:
|
|
cmd: k8s status --wait-ready --timeout 300s
|
|
register: res
|
|
become: true
|
|
changed_when: false
|
|
failed_when: 'res.rc != 0 or not res.stdout is ansible.builtin.regex(multiline=true, match_type="search", pattern="cluster status:\ *ready")'
|
|
|
|
- name: Get k8s config
|
|
ansible.builtin.command:
|
|
cmd: k8s config
|
|
become: true
|
|
register: kubeconfig
|
|
|
|
- name: Copy kubeconfig to local
|
|
ansible.builtin.copy:
|
|
content: '{{ kubeconfig.stdout }}'
|
|
dest: '{{ ansible_env.HOME }}/kubeconfig'
|
|
mode: '0644'
|
|
owner: '{{ ansible_user }}'
|