-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add config to enable/disable hover #69
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
33f8ad1
add config to enable/disable hover
yungezz fb163ef
fix travis
yungezz d557b33
fix os seperator in docker
yungezz cdaf197
show nice error msg when yaml file invalid, then failed to hover or s…
yungezz b198dd1
add toc to readme
yungezz c8aee18
fix readme format
yungezz 46c96e9
refine readme
yungezz 09f2111
resolve comments
yungezz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
[![Travis CI](https://travis-ci.org/VSChina/vscode-ansible.svg?branch=master)](https://travis-ci.org/VSChina/vscode-ansible) | ||
[![AppVeyor](https://ci.appveyor.com/api/projects/status/kq11m16pl22k29un?svg=true)](https://ci.appveyor.com/project/yungez/vscode-ansible) | ||
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/vscoss.vscode-ansible.svg "Current Release")](https://marketplace.visualstudio.com/items?itemName=vscoss.vscode-ansible) | ||
|
||
# Visual Studio Code extension for Ansible | ||
|
||
#### Table of Content | ||
- [Overview](#overview) | ||
- [Features](#features) | ||
- [Prerequisites](#prerequisites) | ||
- [Usage](#usage) | ||
- [Auto completion](#auto-completion) | ||
- [Code Snippets](#code-snippets) | ||
- [Run Ansible playbook](#run-ansible-playbook) | ||
- [Run Playbook in Docker](#run-playbook-in-docker) | ||
- [Run Playbook in Local Ansible](#run-playbook-in-local-ansible) | ||
- [Run Playbook in Cloud Shell](#run-playbook-in-cloud-shell) | ||
- [Run Playbook Remotely via ssh](#run-playbook-remotely-via-ssh) | ||
- [Configuration](#configuration) | ||
- [Feedback and Questions](#feedback-and-questions) | ||
- [License](#license) | ||
- [Telemetry](#telemetry) | ||
|
||
|
||
## Overview | ||
This extension helps to use [Ansible](https://www.ansible.com/) efficiently in VSCode. | ||
|
||
|
@@ -19,21 +38,21 @@ This extension helps to use [Ansible](https://www.ansible.com/) efficiently in V | |
- Run playbook remotely via ssh. | ||
|
||
|
||
## Requirements | ||
## Prerequisites | ||
|
||
|platform|prerequisite| | ||
|--------|-----------| | ||
|Run Playbook in Cloud Shell/remotely via ssh| nodejs >= 6.0 | | ||
|Run Playbook in Cloud Shell/Remotely via ssh| nodejs >= 6.0 | | ||
|Run Playbook in Docker|Docker| | ||
|Run Playbook in Local Ansible| Ansible | | ||
|
||
## Usage | ||
- Auto completion | ||
- Code snippets | ||
Press `Ctrl + Space` in playbook yml file, you'll see Ansible modules code snippets. | ||
![auto completion and code snippets](./images/authoring.gif) | ||
### Auto completion | ||
### Code snippets | ||
Press `Ctrl + Space` in playbook yml file, you'll see Ansible modules code snippets. | ||
![auto completion and code snippets](./images/authoring.gif) | ||
|
||
- Run Ansible playbook commands | ||
### Run Ansible playbook | ||
4 methods are supported to run Ansible playbook: | ||
- Docker. | ||
- Local Ansible installation. | ||
|
@@ -42,50 +61,50 @@ This extension helps to use [Ansible](https://www.ansible.com/) efficiently in V | |
|
||
![run playbook](./images/menu.png) | ||
|
||
- **Run Playbook in Docker** | ||
1. Make sure Docker is installed and running. For Non-windows platform, please configure Docker run without sudo. | ||
1. For Windows user, please share your Windows driver where vscode workspace sits on with docker. This is because the extension will map your workspace containing playbook with docker. | ||
![docker share driver](./images/dockerconfig.png) | ||
1. Press `F1`, type: `ansible`, choose `Run Ansible Playbook in Docker`. | ||
Or right click your playbook yaml file, choose `Run Ansible Playbook in Docker`. | ||
1. Input playbook file full path, or use default one. | ||
1. This step is optinal. If you want to run cloud provider specific Ansible modules, you need set cloud credentials in credential yaml file, default path is `$HOME/.vscode/ansible-credentials.yml`, or change credential file path by settings item `ansible.credentialsFile`. Credential file template is at [here](https://github.com/VSChina/vscode-ansible/blob/master/config/credentials.yml). | ||
#### Run Playbook in Docker | ||
1. Make sure Docker is installed and running. For Non-windows platform, please configure Docker run without sudo. | ||
1. For Windows user, please share your Windows driver where vscode workspace sits on with docker. This is because the extension will map your workspace containing playbook with docker. | ||
![docker share driver](./images/dockerconfig.png) | ||
1. This step is optinal. If you want to run cloud provider specific Ansible modules, you need set cloud credentials in credential yaml file, default path is `$HOME/.vscode/ansible-credentials.yml`, or change credential file path by settings item `ansible.credentialsFile`. Credential file template is at [here](https://github.com/VSChina/vscode-ansible/blob/master/config/credentials.yml). | ||
1. Press `F1`, type: `ansible`, choose `Run Ansible Playbook in Docker`. Or right click playbook yaml file, choose `Run Ansible Playbook in Docker`. | ||
1. Input playbook file full path, or use default one. | ||
|
||
|
||
***NOTE*** | ||
- Docker on windows is not as stable as on other platforms, please try to restart Docker in case of any issue. | ||
- Downloading Docker image first time usage may be time consuming in case of slow network connection. | ||
|
||
- **Run Playbook in Local Ansible** | ||
1. Make sure Ansible is installed. | ||
1. Press `F1`, type: `ansible`, choose `Run Ansible Playbook in Local Ansible`. | ||
Or right click your playbook yaml file, choose `Run Ansible Playbook in Local Ansible`. | ||
1. This step is optinal. If you want to run cloud provider specific Ansible modules, please setup cloud credentials by following [Ansible instruction](http://docs.ansible.com/ansible/latest/guides.html). Or you can set cloud credentials in credential yaml file, default path is `$HOME/.vscode/ansible-credentials.yml`, or change credential file path by settings item `ansible.credentialsFile`. Credential file template is at [here](https://github.com/VSChina/vscode-ansible/blob/master/config/credentials.yml). | ||
|
||
|
||
- **Run Playbook in [Cloud Shell](https://azure.microsoft.com/en-us/features/cloud-shell/)** | ||
1. **Important** Please setup Cloud Shell for first time usage in Azure Portal by following [this instruction](https://docs.microsoft.com/en-us/azure/cloud-shell/overview). After setup, input cmd `az account show` to learn your current subscription setting. | ||
1. Install [Azure Account](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) VSCode extension, which is used for Azure login. | ||
1. Press `F1`, type: `Azure: Sign In`, do Azure login. | ||
1. Press `F1`, type: `ansible`, choose `Run Ansible Playbook in Cloud Shell`. | ||
1. Input playbook file full path, or use default one. | ||
1. Confirm awareness on Azure usage fee. Please refer to [this document](https://docs.microsoft.com/en-us/azure/cloud-shell/pricing) to learn more about Azure Cloud Shell pricing. | ||
***NOTE*** | ||
- Docker on windows is not as stable as on other platforms, please try to restart Docker in case of any issue. | ||
- Downloading Docker image first time usage may be time consuming in case of slow network connection. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Windows should be uppercase everywhere as it's product name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
|
||
#### Run Playbook in Local Ansible | ||
1. Make sure Ansible is installed. | ||
1. This step is optinal. If you want to run cloud provider specific Ansible modules, please setup cloud credentials by following [Ansible instruction](http://docs.ansible.com/ansible/latest/guides.html). Or you can set cloud credentials in credential yaml file, default path is `$HOME/.vscode/ansible-credentials.yml`, or change credential file path by settings item `ansible.credentialsFile`. Credential file template is at [here](https://github.com/VSChina/vscode-ansible/blob/master/config/credentials.yml). | ||
1. Press `F1`, type: `ansible`, choose `Run Ansible Playbook in Local Ansible`. Or right click playbook yaml file, choose `Run Ansible Playbook in Local Ansible`. | ||
|
||
|
||
|
||
#### Run Playbook in Cloud Shell | ||
1. **Important** Please setup Cloud Shell for first time usage in Azure Portal by following [this instruction](https://docs.microsoft.com/en-us/azure/cloud-shell/overview). After setup, input cmd `az account show` to learn your current subscription setting. | ||
1. Install [Azure Account](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) VSCode extension, which is used for Azure login. | ||
1. Press `F1`, type: `Azure: Sign In`, do Azure login. | ||
1. Press `F1`, type: `ansible`, choose `Run Ansible Playbook in Cloud Shell`. Or right click playbook yaml file, choose `Run Ansible Playbook in Cloud Shell`. | ||
1. Input playbook file full path, or use default one. | ||
1. Confirm awareness on Azure usage fee. Please refer to [this document](https://docs.microsoft.com/en-us/azure/cloud-shell/pricing) to learn more about Azure Cloud Shell pricing. | ||
|
||
- **Run Playbook Remotely via ssh** | ||
1. Configure your remote server in `$HOME/.ssh/servers.json` like below. Or follow wizard to fill in server information. | ||
``` | ||
[ | ||
{ | ||
"host": "your host", | ||
"port": 22, | ||
"user": "your user name", | ||
"password": "your ssh password", | ||
"key": "your private key" | ||
} | ||
] | ||
``` | ||
|
||
- Configuration | ||
This extension provides 2 configurations in settings.json. | ||
#### Run Playbook Remotely via ssh | ||
1. Configure your remote server in `$HOME/.ssh/servers.json` like below. Or follow wizard to fill in server information. | ||
``` | ||
[ | ||
{ | ||
"host": "your host", | ||
"port": 22, | ||
"user": "your user name", | ||
"password": "your ssh password", | ||
"key": "your private key" | ||
} | ||
] | ||
``` | ||
|
||
## Configuration | ||
This extension provides 2 configurations in settings.json. | ||
- `ansible.credentialsFile` | ||
This configuration is used to specify ansible credentials file path. Default is `$HOME/.vscode/ansible-credentials.yml`. | ||
- `ansible.termininalInitCommand` | ||
|
@@ -104,10 +123,3 @@ This extension collects telemetry data to help improve our products. Please read | |
telemetry.enableTelemetry = false | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-windows -> non-Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved