From fffc456f5af59d6c31ed2b77833a2384606137df Mon Sep 17 00:00:00 2001 From: lavado Date: Mon, 10 Aug 2020 22:03:30 +0000 Subject: [PATCH] updates to snmp setcomm package --- snmp_setcomm_ee_vnf/cloud_init/vyos-userdata | 3 +-- .../helm-charts/eechart/snmp/generator.yml | 2 +- .../helm-charts/eechart/source/community.yaml | 8 +++++++ .../helm-charts/eechart/source/touch.yaml | 10 --------- .../helm-charts/eechart/source/vnf_ee.py | 2 +- snmp_setcomm_ee_vnf/snmp_setcomm_ee_vnfd.yaml | 21 +++++++------------ 6 files changed, 19 insertions(+), 27 deletions(-) create mode 100644 snmp_setcomm_ee_vnf/helm-charts/eechart/source/community.yaml delete mode 100644 snmp_setcomm_ee_vnf/helm-charts/eechart/source/touch.yaml diff --git a/snmp_setcomm_ee_vnf/cloud_init/vyos-userdata b/snmp_setcomm_ee_vnf/cloud_init/vyos-userdata index 6466aa9d..65a20db7 100644 --- a/snmp_setcomm_ee_vnf/cloud_init/vyos-userdata +++ b/snmp_setcomm_ee_vnf/cloud_init/vyos-userdata @@ -15,8 +15,7 @@ set service ssh listen-address 0.0.0.0 set service ssh port 22 set system login user osm authentication plaintext-password osm2020 # SNMP -set service snmp community public authorization ro set service snmp location "OSM Labs" # Save commit -save \ No newline at end of file +save diff --git a/snmp_setcomm_ee_vnf/helm-charts/eechart/snmp/generator.yml b/snmp_setcomm_ee_vnf/helm-charts/eechart/snmp/generator.yml index 18c862ce..5e05b829 100644 --- a/snmp_setcomm_ee_vnf/helm-charts/eechart/snmp/generator.yml +++ b/snmp_setcomm_ee_vnf/helm-charts/eechart/snmp/generator.yml @@ -11,4 +11,4 @@ modules: lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName auth: # Community string is used with SNMP v1 and v2. Defaults to "public". - community: public + community: secret diff --git a/snmp_setcomm_ee_vnf/helm-charts/eechart/source/community.yaml b/snmp_setcomm_ee_vnf/helm-charts/eechart/source/community.yaml new file mode 100644 index 00000000..0d5d7061 --- /dev/null +++ b/snmp_setcomm_ee_vnf/helm-charts/eechart/source/community.yaml @@ -0,0 +1,8 @@ +--- +- hosts: all + connection: local + tasks: + - name: change SNMP community + vyos_config: + lines: + - set service snmp community "{{ snmp_community }}" authorization ro diff --git a/snmp_setcomm_ee_vnf/helm-charts/eechart/source/touch.yaml b/snmp_setcomm_ee_vnf/helm-charts/eechart/source/touch.yaml deleted file mode 100644 index f427644f..00000000 --- a/snmp_setcomm_ee_vnf/helm-charts/eechart/source/touch.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: This is a hello-world example - hosts: all - tasks: - - name: Create a file called '/tmp/testfile.txt' with the content 'hello world'. - copy: - content: hello worldn - dest: "{{ file_path }}" - - diff --git a/snmp_setcomm_ee_vnf/helm-charts/eechart/source/vnf_ee.py b/snmp_setcomm_ee_vnf/helm-charts/eechart/source/vnf_ee.py index 7c976e1f..6b1f4805 100755 --- a/snmp_setcomm_ee_vnf/helm-charts/eechart/source/vnf_ee.py +++ b/snmp_setcomm_ee_vnf/helm-charts/eechart/source/vnf_ee.py @@ -72,7 +72,7 @@ class VnfEE: self._check_required_params(params, ["playbook-name"]) params["ansible_user"] = self.config_params["ssh-username"] - #params["ansible_password"] = self.config_params["ssh-password"] + params["ansible_password"] = self.config_params["ssh-password"] inventory = self.config_params["ssh-hostname"] + "," diff --git a/snmp_setcomm_ee_vnf/snmp_setcomm_ee_vnfd.yaml b/snmp_setcomm_ee_vnf/snmp_setcomm_ee_vnfd.yaml index b3432ecd..461b9067 100644 --- a/snmp_setcomm_ee_vnf/snmp_setcomm_ee_vnfd.yaml +++ b/snmp_setcomm_ee_vnf/snmp_setcomm_ee_vnfd.yaml @@ -48,10 +48,6 @@ vnfd-catalog: mgmt-interface: cp: vnf-mgmt vnf-configuration: - config-access: - ssh-access: - default-user: ubuntu - required: true execution-environment-list: - id: monitor helm-chart: eechart @@ -65,7 +61,9 @@ vnfd-catalog: - name: ssh-hostname value: - name: ssh-username - value: ubuntu + value: osm + - name: ssh-password + value: osm2020 - seq: 2 name: generate_snmp execution-environment-ref: monitor @@ -74,19 +72,16 @@ vnfd-catalog: execution-environment-ref: monitor parameter: - name: playbook-name - value: touch.yaml - - name: file_path - value: /var/tmp/test-touch.txt + value: community.yaml + - name: snmp_community + value: secret config-primitive: - name: generate_snmp execution-environment-ref: monitor - - name: touch + - name: ansible_playbook execution-environment-ref: monitor execution-environment-primitive: ansible_playbook parameter: - name: playbook-name - default-value: touch - data-type: STRING - - name: file-path - default-value: /var/tmp/test-touch2.txt + default-value: playbook.yaml data-type: STRING -- GitLab