Update scripts
This commit is contained in:
		
							parent
							
								
									2c84b2effa
								
							
						
					
					
						commit
						34cb04dc6d
					
				
					 5 changed files with 45 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -28,23 +28,27 @@ fi
 | 
			
		|||
pass_content=$(pass "ansible/$project")
 | 
			
		||||
pass_path=$project_dir/$(echo "$pass_content" | grep "path:" | cut -d' ' -f2-)
 | 
			
		||||
 | 
			
		||||
case "$1" in
 | 
			
		||||
action="${1:-show}"
 | 
			
		||||
case "$action" in
 | 
			
		||||
	show)
 | 
			
		||||
		echo "$pass_content" | head -n 1
 | 
			
		||||
		exit 0 ;;
 | 
			
		||||
	view)
 | 
			
		||||
		ansible-vault view "$pass_path"
 | 
			
		||||
		exit 0 ;;
 | 
			
		||||
	edit)
 | 
			
		||||
		ansible-vault edit "$pass_path"
 | 
			
		||||
		exit 0
 | 
			
		||||
		;;
 | 
			
		||||
		exit 0 ;;
 | 
			
		||||
	deploy)
 | 
			
		||||
		pass show "ansible/$project.file" > "$pass_path"
 | 
			
		||||
		exit 0
 | 
			
		||||
		;;
 | 
			
		||||
		exit 0 ;;
 | 
			
		||||
	save)
 | 
			
		||||
		pass insert -m "ansible/$project.file" < "$pass_path"
 | 
			
		||||
		exit 0
 | 
			
		||||
		;;
 | 
			
		||||
		exit 0 ;;
 | 
			
		||||
	pass-edit)
 | 
			
		||||
		pass edit "ansible/$project"
 | 
			
		||||
		exit 0
 | 
			
		||||
		;;
 | 
			
		||||
		exit 0 ;;
 | 
			
		||||
	*)
 | 
			
		||||
		echo "Usage: ansible-vault-manager [show|view|edit|deploy|save|pass-edit]"
 | 
			
		||||
		exit 0 ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
echo "$pass_content" | head -n 1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue