Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
s1061123 committed Feb 28, 2021
1 parent 59d8c3e commit c8b4850
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 45 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Ansible Lint # feel free to pick your own name

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- uses: actions/checkout@v2

# - name: Install Ansible galaxy roles
# run: ansible-galaxy install -r requirements.yml

- name: Lint Ansible Playbook
# replace "master" with any valid ref
uses: ansible/ansible-lint-action@master
with:
# [required]
# Paths to ansible files (i.e., playbooks, tasks, handlers etc..)
# or valid Ansible directories according to the Ansible role
# directory structure.
# If you want to lint multiple ansible files, use the following syntax
# targets: |
# playbook_1.yml
# playbook_2.yml
targets: |
playbooks/virthost-setup.yml
playbooks/kube-install.yml
playbooks/kube-install-ovn.yml
# [optional]
# Arguments to override a package and its version to be set explicitly.
# Must follow the example syntax.
override-deps: |
ansible==2.10.6
ansible-lint==5.0.2
# [optional]
# Arguments to be passed to the ansible-lint
# Options:
# -q quieter, although not silent output
# -p parseable output in the format of pep8
# --parseable-severity parseable output including severity of rule
# -r RULESDIR specify one or more rules directories using one or
# more -r arguments. Any -r flags override the default
# rules in ansiblelint/rules, unless -R is also used.
# -R Use default rules in ansiblelint/rules in addition to
# any extra
# rules directories specified with -r. There is no need
# to specify this if no -r flags are used
# -t TAGS only check rules whose id/tags match these values
# -x SKIP_LIST only check rules whose id/tags do not match these
# values
# --nocolor disable colored output
# --exclude=EXCLUDE_PATHS
# path to directories or files to skip. This option is
# repeatable.
# -c C Specify configuration file to use. Defaults to ".ansible-lint"
args: "-x risky-file-permissions -x role-name"
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion playbooks/kube-install-ovn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
sysctl_set: yes
state: present
reload: yes
- name: Load module if parameter is not in node # noqa 301
- name: Load module if parameter is not in node # noqa no-changed-when
shell: >
if [ ! -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then \
modprobe br_netfilter; \
Expand Down
2 changes: 1 addition & 1 deletion playbooks/kube-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
sysctl_set: yes
state: present
reload: yes
- name: Load module if parameter is not in node # noqa 301
- name: Load module if parameter is not in node # noqa no-changed-when
shell: >
if [ ! -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then \
modprobe br_netfilter; \
Expand Down
4 changes: 2 additions & 2 deletions roles/bridge-setup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Install bridge-utils and firewalld # noqa 403
- name: Install bridge-utils and firewalld # noqa package-latest
yum:
name: bridge-utils,firewalld
state: latest
Expand All @@ -10,7 +10,7 @@
state: started
enabled: yes

- name: Accept bridge forwarding and accept packets # noqa 301
- name: Accept bridge forwarding and accept packets # noqa no-changed-when
shell: >
firewall-cmd --permanent --direct --passthrough ipv4 -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT;
firewall-cmd --permanent --direct --passthrough ipv4 -D INPUT -j REJECT --reject-with icmp-host-prohibited
Expand Down
14 changes: 7 additions & 7 deletions roles/cri-o-install/tasks/build_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@
dest: "{{ ansible_env.HOME }}/{{ gopath }}/src/github.com/containernetworking/plugins"
version: master

- name: build runc # noqa 301
- name: build runc # noqa no-changed-when
shell: |
cd {{ ansible_env.HOME }}/{{ gopath }}/src/github.com/opencontainers/runc && \
export GOPATH={{ ansible_env.HOME }}/{{ gopath }} && \
make BUILDTAGS="seccomp selinux" && make install
environment:
PATH: "{{ extended_path }}"

- name: link runc # noqa 301
- name: link runc # noqa no-changed-when
file:
src: /usr/local/sbin/runc
dest: /usr/bin/runc
state: link

- name: build cri-o # noqa 301
- name: build cri-o # noqa no-changed-when
shell: |
cd {{ ansible_env.HOME }}/{{ gopath }}/src/github.com/cri-o/cri-o && \
make && \
Expand All @@ -99,7 +99,7 @@
PATH: "{{ extended_path }}"
GOPATH: "{{ ansible_env.HOME }}/{{ gopath }}"

- name: build conmon # noqa 301
- name: build conmon # noqa no-changed-when
shell: |
cd {{ ansible_env.HOME }}/{{ gopath }}/src/github.com/containers/conmon && \
make && \
Expand All @@ -108,7 +108,7 @@
PATH: "{{ extended_path }}"
GOPATH: "{{ ansible_env.HOME }}/{{ gopath }}"

- name: build cri-tools # noqa 301
- name: build cri-tools # noqa no-changed-when
shell: |
cd {{ ansible_env.HOME }}/{{ gopath }}/src/github.com/kubernetes-sigs/cri-tools && \
make && \
Expand All @@ -117,7 +117,7 @@
PATH: "{{ extended_path }}"
GOPATH: "{{ ansible_env.HOME }}/{{ gopath }}"

- name: build CNI stuff # noqa 301
- name: build CNI stuff # noqa no-changed-when
shell: |
cd {{ ansible_env.HOME }}/{{ gopath }}/src/github.com/containernetworking/plugins && \
./build_linux.sh && \
Expand Down Expand Up @@ -154,7 +154,7 @@
sysctl_set: yes
sysctl_file: /etc/sysctl.conf

- name: systemd dropin for kubeadm # noqa 301
- name: systemd dropin for kubeadm # noqa no-changed-when
shell: >
sh -c 'echo "[Service]
Environment=\"KUBELET_EXTRA_ARGS=--container-runtime=remote
Expand Down
2 changes: 1 addition & 1 deletion roles/cri-o-install/tasks/pkg_copr_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
with_items:
- /etc/systemd/system/kubelet.service.d/

- name: systemd dropin for kubeadm # noqa 301
- name: systemd dropin for kubeadm # noqa no-changed-when
shell: >
sh -c 'echo "[Service]
Environment=\"KUBELET_EXTRA_ARGS=--cgroup-driver=systemd
Expand Down
2 changes: 1 addition & 1 deletion roles/kube-init/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
path: /etc/.kubeadm-complete
state: directory

- name: Get join command # noqa 301
- name: Get join command # noqa no-changed-when
shell: >
kubeadm token create --print-join-command
register: kubeadm_join_output
Expand Down
6 changes: 3 additions & 3 deletions roles/multus-2nics-setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
group: root
mode: 0755

- name: Delete automatically created connection # noqa 301
- name: Delete automatically created connection # noqa no-changed-when
shell: |
nmcli d disconnect eth1 && \
nmcli c delete 'Wired connection 1'
Expand All @@ -39,10 +39,10 @@
dest: /etc/sysconfig/network-scripts/ifcfg-eth1.1
when: "'master' in group_names"

- name: Reload NetworkManager connection # noqa 301
- name: Reload NetworkManager connection # noqa no-changed-when
command: nmcli connection reload

- name: bring up eth1 # noqa 301
- name: bring up eth1 # noqa no-changed-when
command: nmcli c up eth1

- name: rename eth1.1 connection name
Expand Down
11 changes: 6 additions & 5 deletions roles/ovnkube-setup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Taint master nodes # noqa 301
- name: Taint master nodes # noqa no-changed-when
command: kubectl taint nodes --all node-role.kubernetes.io/master-
failed_when: false

Expand All @@ -9,7 +9,7 @@
path: ${HOME}/work/src/github.com/ovn-org
state: directory

- name: git clone # noqa 401
- name: git clone # noqa git-latest
git:
repo: "{{ ovn_kubernetes_repo | default('https://github.com/ovn-org/ovn-kubernetes') }}"
dest: ${HOME}/work/src/github.com/ovn-org/ovn-kubernetes
Expand Down Expand Up @@ -78,10 +78,11 @@
- ovnkube-node.yaml
when: enable_ovn_raft is not defined and not enable_ovn_raft

- name: Patch coredns
- name: Patch coredns # noqa no-changed-when
command: |
kubectl -n kube-system patch deploy coredns -p '{"spec":{"template":{"metadata":{"annotations": {"kubernetes.io/egress-bandwidth": "1M", "kubernetes.io/ingress-bandwidth": "1M"}}}}}'
kubectl -n kube-system patch deploy coredns -p \
'{"spec":{"template":{"metadata":{"annotations": {"kubernetes.io/egress-bandwidth": "1M", "kubernetes.io/ingress-bandwidth": "1M" }}}}}'
- name: Stop kube-proxy daemonset # noqa 301
- name: Stop kube-proxy daemonset # noqa no-changed-when
command: kubectl -n kube-system delete ds kube-proxy
failed_when: false

0 comments on commit c8b4850

Please sign in to comment.