Skip to content

Commit

Permalink
Adds missing "mode" to tasks with copy and file modules
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzyfriday committed Jul 30, 2024
1 parent ad0110d commit 9f81225
Show file tree
Hide file tree
Showing 102 changed files with 147 additions and 2 deletions.
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ enable_list:
skip_list:
- jinja[spacing] # We don't really want to get that one. Too picky
- no-changed-when # once we get the oc module we can re-enable it
- risky-file-permissions # Seems to fail on 0644 on files ?!
- schema[meta] # Apparently "CentOS 9" isn't known... ?!
- schema[vars] # weird issue with some "vars" in playbooks
- yaml[line-length] # We have long lines, yes.
Expand Down
1 change: 1 addition & 0 deletions ci/playbooks/build_runner_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
ansible.builtin.file:
path: "{{ ansible_user_dir }}/ci-framework-data/artifacts"
state: directory
mode: "0755"

- name: Create EDPM ansible var file
ansible.builtin.copy:
Expand Down
2 changes: 2 additions & 0 deletions ci/playbooks/collect-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
ansible.builtin.file:
path: "{{ ansible_user_dir }}/zuul-output/logs/ci-framework-data"
state: directory
mode: "0755"

- name: Copy ci-framework interesting files
ansible.builtin.shell:
Expand Down Expand Up @@ -106,6 +107,7 @@
ansible.builtin.file:
path: "{{ ansible_user_dir }}/zuul-output/logs/system-config/libvirt"
state: directory
mode: "0755"

- name: Get some of the system configurations
ignore_errors: true # noqa: ignore-errors
Expand Down
1 change: 1 addition & 0 deletions ci/playbooks/dump_zuul_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ansible.builtin.file:
path: "{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters"
state: directory
mode: "0775"

- name: Slurp Zuul inventory test
ansible.builtin.slurp:
Expand Down
1 change: 1 addition & 0 deletions ci/playbooks/multinode-autohold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@
ansible.builtin.file:
path: "{{ ansible_user_dir }}/crc-ci-bootstrap-skip-cleanup"
state: touch
mode: "0644"
1 change: 1 addition & 0 deletions deploy-edpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
ansible.builtin.file:
path: "{{ ansible_user_dir }}/cifmw-success"
state: touch
mode: "0644"

- name: Run log related tasks
ansible.builtin.import_playbook: playbooks/99-logs.yml
Expand Down
1 change: 1 addition & 0 deletions hooks/playbooks/ceph-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
# in further steps.
- name: Extract and push ceph_uuid
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_basedir }}/artifacts/{{ step }}_{{ hook_name }}.yml"
content: |-
cifmw_ceph_conf: {{ cifmw_ceph_conf_encoded }}
Expand Down
1 change: 1 addition & 0 deletions hooks/playbooks/control_plane_ceph_backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ansible.builtin.file:
path: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane"
state: directory
mode: "0775"

- name: Create kustomization to add Ceph as backend
ansible.builtin.template:
Expand Down
1 change: 1 addition & 0 deletions hooks/playbooks/control_plane_hci_pre_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ansible.builtin.file:
path: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane"
state: directory
mode: "0775"

- name: Create kustomization for HCI pre deploy step
ansible.builtin.copy:
Expand Down
1 change: 1 addition & 0 deletions hooks/playbooks/control_plane_ironic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ansible.builtin.file:
path: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane"
state: directory
mode: "0755"

- name: Create kustomization to enable ironic
ansible.builtin.copy:
Expand Down
1 change: 1 addition & 0 deletions hooks/playbooks/fetch_compute_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
ansible.builtin.file:
path: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/{{ item }}"
state: directory
mode: "0775"
loop:
- dataplane
- controlplane
Expand Down
1 change: 1 addition & 0 deletions hooks/playbooks/kustomize_cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
ansible.builtin.file:
path: "{{ cifmw_kustomize_cr_artifact_dir }}"
state: directory
mode: "0775"

- name: Load vars from previous hooks
when: cifmw_kustomize_cr_include_vars is defined
Expand Down
1 change: 1 addition & 0 deletions playbooks/01-bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@
tags:
- always
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_basedir|default(ansible_user_dir ~ '/ci-framework-data') }}/artifacts/parameters/custom-params.yml"
content: "{{ ci_framework_params | to_nice_yaml }}"
1 change: 1 addition & 0 deletions plugins/modules/generate_make_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
ansible.builtin.file:
path: "{{ ansible_user_dir }}/make_installyamls/tasks"
state: directory
mode: "0775"
- name: Generate make tasks
generate_make_tasks:
Expand Down
1 change: 1 addition & 0 deletions roles/artifacts/tasks/crc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ansible.builtin.file:
path: "{{ cifmw_artifacts_basedir }}/logs/crc"
state: directory
mode: "0775"

- name: Ensure controller knows CRC ssh keys
ignore_errors: true # noqa: ignore-errors
Expand Down
2 changes: 2 additions & 0 deletions roles/artifacts/tasks/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
tags:
- always
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_artifacts_basedir }}/artifacts/ansible-vars.yml"
content: "{{ vars | to_nice_yaml }}"

- name: Gather facts
tags:
- always
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_artifacts_basedir }}/artifacts/ansible-facts.yml"
content: "{{ ansible_facts | to_nice_yaml }}"

Expand Down
1 change: 1 addition & 0 deletions roles/artifacts/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
- bootstrap
- packages
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_artifacts_basedir }}/artifacts/installed-packages.yml"
content: "{{ ansible_facts.packages | to_nice_yaml }}"
1 change: 1 addition & 0 deletions roles/build_containers/molecule/hotfix/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ansible.builtin.file:
path: /tmp/rpms
state: directory
mode: "0775"
become: true

- name: Download python3-requests RPM
Expand Down
1 change: 1 addition & 0 deletions roles/build_containers/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ansible.builtin.file:
path: "{{ cifmw_build_containers_basedir }}/{{ item }}"
state: directory
mode: "0775"
loop:
- tmp
- artifacts
Expand Down
1 change: 1 addition & 0 deletions roles/build_openstack_packages/tasks/install_dlrn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
ansible.builtin.file:
path: '{{ cifmw_bop_build_repo_dir }}/DLRN/'
state: directory
mode: "0775"

- name: Remove data files from previous runs
ansible.builtin.shell:
Expand Down
1 change: 1 addition & 0 deletions roles/build_openstack_packages/tasks/run_dlrn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
ansible.builtin.file:
path: "{{ cifmw_bop_build_repo_dir }}/DLRN/data/"
state: directory
mode: "0775"

- name: "Check for existing {{ project_name_mapped.stdout }}" # noqa: name[template]
ansible.builtin.stat:
Expand Down
1 change: 1 addition & 0 deletions roles/cert_manager/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
ca:
secretName: root-secret
ansible.builtin.copy:
mode: "0644"
dest: "/tmp/cmtest.yaml"
content: "{{ _ca_content }}"

Expand Down
1 change: 1 addition & 0 deletions roles/cert_manager/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ansible.builtin.file:
path: "{{ cifmw_cert_manager_manifests_dir }}"
state: directory
mode: "0775"

- name: Create the cifmw_cert_manager_operator_namespace namespace"
kubernetes.core.k8s:
Expand Down
1 change: 1 addition & 0 deletions roles/ci_local_storage/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ansible.builtin.file:
path: "{{ cifmw_cls_manifests_dir }}"
state: directory
mode: "0775"

- name: Create the cifmw_cls_namespace namespace"
kubernetes.core.k8s:
Expand Down
1 change: 1 addition & 0 deletions roles/ci_metallb/tasks/metallb_k8s_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

- name: Save k8s metallb OLM manifests as artifacts
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_ci_metallb_manifests_dir }}/metallb-{{ item.kind | lower }}-olm.yaml"
content: "{{ item | to_nice_yaml }}"
loop:
Expand Down
1 change: 1 addition & 0 deletions roles/ci_netconfig/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ansible.builtin.file:
path: "{{ cifmw_ci_netconfig_manifests_dir }}"
state: directory
mode: "0775"

- name: Create network config definitions in manifest dir
vars:
Expand Down
2 changes: 2 additions & 0 deletions roles/ci_nmstate/tasks/nmstate_k8s_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

- name: Save k8s nmstate OLM manifests as artifacts
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_ci_nmstate_manifests_dir }}/nmstate-{{ item.kind | lower }}-olm.yaml"
content: "{{ item | to_nice_yaml }}"
loop:
Expand Down Expand Up @@ -58,6 +59,7 @@

- name: Save nmstate operator config as an artifact
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_ci_nmstate_manifests_dir }}/nmstate-{{ cifmw_ci_nmstate_operator_config.kind | lower }}-olm.yaml"
content: "{{ cifmw_ci_nmstate_operator_config | to_nice_yaml }}"

Expand Down
1 change: 1 addition & 0 deletions roles/ci_nmstate/tasks/nmstate_k8s_provision_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

- name: Save k8s nmstate nncp manifests as artifacts
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_ci_nmstate_manifests_dir }}/{{ item }}-nncp.yaml"
content: "{{ _cifmw_ci_nmstate_k8s_node_config | to_nice_yaml }}"

Expand Down
2 changes: 2 additions & 0 deletions roles/ci_nmstate/tasks/nmstate_unmanaged_provision_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

- name: "Save nmstate state for {{ cifmw_ci_nmstate_unmanaged_host }}"
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_ci_nmstate_configs_dir }}/{{ cifmw_ci_nmstate_unmanaged_host }}-state.yaml"
content: "{{ cifmw_ci_nmstate_unmanaged_node_config | to_nice_yaml }}"

Expand All @@ -40,5 +41,6 @@

- name: "Save nmstate debugging data for {{ cifmw_ci_nmstate_unmanaged_host }}"
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_ci_nmstate_configs_dir }}/{{ cifmw_ci_nmstate_unmanaged_host }}-final-state.yaml"
content: "{{ _cifmw_ci_nmstate_unmanaged_node_state_out.state | to_nice_yaml }}"
1 change: 1 addition & 0 deletions roles/cifmw_ceph_client/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
ansible.builtin.file:
path: "{{ cifmw_ceph_client_config_home | default('/etc/ceph') }}"
state: "directory"
mode: "0775"
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

- name: Write source service values to destination with modified keys
ansible.builtin.copy:
mode: "0644"
content: "{{ yaml_content.content | b64decode | from_yaml
| combine(modified_keys, recursive=True) | to_nice_yaml }}"
dest: "{{ cifmw_ceph_client_service_values_post_ceph_path_dst }}"
Expand Down
1 change: 1 addition & 0 deletions roles/cifmw_ceph_client/tasks/edpm_values_post_ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

- name: Write source values to destination with modified keys
ansible.builtin.copy:
mode: "0644"
content: "{{ yaml_content.content | b64decode | from_yaml
| combine(modified_keys, recursive=True) | to_nice_yaml }}"
dest: "{{ cifmw_ceph_client_values_post_ceph_path_dst }}"
Expand Down
1 change: 1 addition & 0 deletions roles/cifmw_cephadm/tasks/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
ansible.builtin.file:
path: "{{ cifmw_ceph_client_vars | dirname }}"
state: directory
mode: "0755"
recurse: true
delegate_to: localhost
when:
Expand Down
1 change: 1 addition & 0 deletions roles/cifmw_cephadm/tasks/pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
ansible.builtin.file:
path: "{{ cifmw_cephadm_config_home }}"
state: directory
mode: "0755"
become: true

- name: Ensure specs directory exists
Expand Down
1 change: 1 addition & 0 deletions roles/copy_container/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ansible.builtin.file:
path: "{{ cifmw_copy_ct_basedir }}/{{ item }}"
state: directory
mode: "0775"
loop:
- artifacts
- logs
Expand Down
2 changes: 2 additions & 0 deletions roles/devscripts/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@

- name: Create a dummy pull secret file
ansible.builtin.copy:
mode: "0644"
content: "hello world"
dest: '/tmp/pull-secret'

- name: Create a dummy pull secret file
ansible.builtin.copy:
mode: "0644"
content: "hello world"
dest: '/tmp/ci_token'

Expand Down
1 change: 1 addition & 0 deletions roles/edpm_build_images/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
ansible.builtin.file:
path: "{{ cifmw_edpm_build_images_basedir }}/logs/edpm_images"
state: directory
mode: "0775"
tags:
- bootstrap
1 change: 1 addition & 0 deletions roles/edpm_deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
block:
- name: Create the config file
ansible.builtin.copy:
mode: "0644"
content: "{{ cifmw_edpm_deploy_nova_compute_extra_config }}"
dest: "{{ _cifmw_edpm_deploy_nova_extra_config_file }}"

Expand Down
2 changes: 2 additions & 0 deletions roles/edpm_kustomize/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
ansible.builtin.file:
path: "{{ cifmw_basedir }}/artifacts/manifests/openstack/dataplane/cr"
state: directory
mode: "0775"

- name: Clone dummy operator # noqa: latest[git]
ansible.builtin.git:
Expand All @@ -43,6 +44,7 @@

- name: Copy dataplane sample
ansible.builtin.copy:
mode: "0644"
remote_src: true
src: "{{ cifmw_basedir }}/src/openstack-operator/config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml"
dest: "{{ cifmw_basedir }}/artifacts/manifests/openstack/dataplane/cr/dataplane_v1beta1_openstackdataplanenodeset.yaml"
1 change: 1 addition & 0 deletions roles/edpm_kustomize/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
ansible.builtin.file:
path: "{{ cifmw_edpm_kustomize_cr_path | dirname }}"
state: directory
mode: "0775"

- name: Check if there is already a kustomization
register: cifmw_edpm_kustomize_kustomize_yaml_stat
Expand Down
1 change: 1 addition & 0 deletions roles/env_op_images/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ansible.builtin.file:
path: "{{ cifmw_env_op_images_dir }}/{{ item }}"
state: directory
mode: "0775"
loop:
- artifacts
- logs
Expand Down
1 change: 1 addition & 0 deletions roles/hci_prepare/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
mtu: 9000
vlan: 10
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_basedir }}/artifacts/parameters/network_info.yml"
content: "{{ file_content | to_nice_yaml }}"

Expand Down
3 changes: 3 additions & 0 deletions roles/hci_prepare/tasks/phase1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
ansible.builtin.file:
path: "{{ cifmw_hci_prepare_dataplane_dir }}"
state: directory
mode: "0755"

- name: Prepare EDPM network for HCI deployment
when:
- cifmw_hci_prepare_enable_storage_mgmt
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_hci_prepare_dataplane_dir }}/89-storage-mgmt-kustomization.yaml"
content: |-
apiVersion: kustomize.config.k8s.io/v1beta1
Expand All @@ -47,6 +49,7 @@
- name: Enable services needed to deploy Ceph
ansible.builtin.copy:
mode: "0644"
dest: "{{ cifmw_hci_prepare_dataplane_dir }}/88-hci-pre-kustomization.yaml"
content: |-
apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down
Loading

0 comments on commit 9f81225

Please sign in to comment.