Remove private key file reference from ansible.cfg; update hosts file with absolute path for private key; add playbooks for installing tools and updating OS
This commit is contained in:
		@@ -1,4 +1,3 @@
 | 
				
			|||||||
[defaults]
 | 
					[defaults]
 | 
				
			||||||
inventory = hosts
 | 
					inventory = hosts
 | 
				
			||||||
remote_user = vagrant
 | 
					remote_user = vagrant
 | 
				
			||||||
private_key_file = ~/.vagrant.d/insecure_private_key
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1,2 @@
 | 
				
			|||||||
[kube]
 | 
					[kube]
 | 
				
			||||||
kube01 ansible_host=127.0.0.1 ansible_port=2030 ansible_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/kube01/vmware_fusion/private_key
 | 
					kube01 ansible_host=127.0.0.1 ansible_port=2030 ansible_user=vagrant ansible_ssh_private_key_file=/Users/xchose/chosesoft/Vagrant/.vagrant/machines/kube01/vmware_fusion/private_key
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								ansible/install_tools.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								ansible/install_tools.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					- name: Install favorite tools (vim, telnet, curl)
 | 
				
			||||||
 | 
					  hosts: all
 | 
				
			||||||
 | 
					  become: yes
 | 
				
			||||||
 | 
					  tasks:
 | 
				
			||||||
 | 
					    - name: Ensure vim, telnet, and curl are installed
 | 
				
			||||||
 | 
					      ansible.builtin.apt:
 | 
				
			||||||
 | 
					        name:
 | 
				
			||||||
 | 
					          - vim
 | 
				
			||||||
 | 
					          - telnet
 | 
				
			||||||
 | 
					          - curl
 | 
				
			||||||
 | 
					        state: present
 | 
				
			||||||
 | 
					        update_cache: yes
 | 
				
			||||||
 | 
					      register: install_tools_result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Show install result (full)
 | 
				
			||||||
 | 
					      ansible.builtin.debug:
 | 
				
			||||||
 | 
					        var: install_tools_result
 | 
				
			||||||
							
								
								
									
										22
									
								
								ansible/update_os.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								ansible/update_os.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					- name: Update all packages on Ubuntu (interactive)
 | 
				
			||||||
 | 
					  hosts: all
 | 
				
			||||||
 | 
					  become: yes
 | 
				
			||||||
 | 
					  tasks:
 | 
				
			||||||
 | 
					    - name: Update apt cache
 | 
				
			||||||
 | 
					      ansible.builtin.apt:
 | 
				
			||||||
 | 
					        update_cache: yes
 | 
				
			||||||
 | 
					      register: apt_update_result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Show apt update output
 | 
				
			||||||
 | 
					      ansible.builtin.debug:
 | 
				
			||||||
 | 
					        var: apt_update_result.stdout_lines
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Upgrade all packages to the latest version
 | 
				
			||||||
 | 
					      ansible.builtin.apt:
 | 
				
			||||||
 | 
					        upgrade: dist
 | 
				
			||||||
 | 
					      register: apt_upgrade_result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Show apt upgrade output
 | 
				
			||||||
 | 
					      ansible.builtin.debug:
 | 
				
			||||||
 | 
					        var: apt_upgrade_result.stdout_lines
 | 
				
			||||||
		Reference in New Issue
	
	Block a user