File tree 8 files changed +68
-6
lines changed
8 files changed +68
-6
lines changed Original file line number Diff line number Diff line change
1
+ ### napalm scripting ###
2
+
3
+ # napalm module documentation
4
+ ansible-doc napalm_get_facts
Original file line number Diff line number Diff line change
1
+ // install python modules
2
+ sudo apt install python python3 virtualenv python-virtualenv
3
+ cd
4
+ // setup environment
5
+ # switch to root of new project folder
6
+ cd newproj
7
+
8
+ # create a new virtual environment inside the project folder called env
9
+ virtualenv -p /usr/bin/python3 env
10
+
11
+ # change to new working directory to be used as root of new environment
12
+
13
+ # initialize python environment
14
+ source env/bin/activate
15
+
16
+ // setup napalm
17
+ # install modules
18
+ pip install ansible napalm napalm-ansible
19
+
20
+ # can also install modules using a requirements.txt file
21
+ requirements.txt:
22
+ napalm==2.4.0
23
+ click==6.7
24
+
25
+ pip install -r requirements.txt
26
+
27
+ # clone napalm ansible modules from repo
28
+ sudo mkdir -p /usr/share/ansible/plugins/modules
29
+
30
+ sudo git clone https://github.com/napalm-automation/napalm-ansible.git /usr/share/ansible/plugins/modules
31
+ ansible-doc napalm_get_facts
32
+
33
+ # verify installation
34
+ ansible-doc napalm_get_facts
35
+
36
+ // napalm commands
37
+ # napalm connect to device for basic info
38
+ napalm -u cisco -p cisco -v ios csr1kv1 call get_facts
Original file line number Diff line number Diff line change 1
- Terraform
1
+ // view traces //
2
+ export TF_LOG=TRACE
3
+ set 'TF_LOG' environment variable to trace for logging
4
+
5
+ ## dynamic backend files
6
+ terraform init -backend-config './np1/backend.conf'
2
7
8
+ ## dynamic variable files
9
+ terraform plan –var-file ./np1/vars.tf
10
+
11
+ // general notes //
3
12
each file is a representation of a state file back on the storage blob
4
13
14
+ // general commands //
5
15
terraform init: create working directory
6
16
terraform plan: connect to storage account as listed in main.tf file
7
17
compare state in storage account with running state
8
18
show differences
9
19
10
20
terraform apply: apply generated plan
11
21
12
- export TF_LOG=TRACE
13
- set 'TF_LOG' environment variable to trace for logging
22
+
23
+ // manage state file //
24
+ # list items
25
+ terraform state list
26
+
27
+ # remove items
28
+ terraform state rm ADDRESS
29
+
30
+ # show items
31
+ terraform state show ADDRESS
32
+
33
+ # import resource into state file
34
+ terraform import
Original file line number Diff line number Diff line change 1
1
### GNU Linux Cheat Sheet ###
2
2
3
-
4
3
# special permissions for ssh keys
5
4
chmod 600 keyfile.pub
6
5
@@ -56,6 +55,8 @@ screen -d -R name
56
55
screen -r name
57
56
[CTRL+a, d to detach]
58
57
58
+ screen -X -S [# to kill] quit kill the screen session
59
+
59
60
TAR (BACKUP WITH GZIP COMPRESSION)
60
61
tar czfv source dest.tgz
61
62
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments