|
|
|
@ -97,6 +97,7 @@ EXAMPLES = '''
|
|
|
|
|
|
|
|
|
|
|
|
import ConfigParser
|
|
|
|
import ConfigParser
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================================================
|
|
|
|
# ==============================================================
|
|
|
|
# do_ini
|
|
|
|
# do_ini
|
|
|
|
@ -104,6 +105,11 @@ import sys
|
|
|
|
def do_ini(module, filename, section=None, option=None, value=None, state='present', backup=False):
|
|
|
|
def do_ini(module, filename, section=None, option=None, value=None, state='present', backup=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not os.path.exists(filename):
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
open(filename,'w').close()
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
module.fail_json(msg="Destination file %s not writable" % filename)
|
|
|
|
ini_file = open(filename, 'r')
|
|
|
|
ini_file = open(filename, 'r')
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
ini_lines = ini_file.readlines()
|
|
|
|
ini_lines = ini_file.readlines()
|
|
|
|
|